Renamed namespaces and projects from DocumentOperator to DocumentService, updating all references accordingly. Refactored PdfSignatureAppearanceDto and related enums to use properties with init accessors for improved clarity. Removed and re-added IPkcs11SelfTestStatusProvider with updated namespace. Simplified dependency injection by removing DocumentOperatorApplication registration. Updated appsettings.json with a specific AssetsRootPath. Incremented version numbers in project files for a new release. Introduced PdfSignatureClient and IPdfSignatureClient for PDF digital-signing operations. Updated project files to use newer Microsoft.Extensions package versions. Removed all DocumentOperator references, completing the transition to DocumentService. Added new DTOs and enums for PDF signature options and appearance.
30 lines
1.5 KiB
C#
30 lines
1.5 KiB
C#
using DocumentService.Application.Common.DTOs;
|
|
|
|
namespace DocumentService.Application.Common.Interfaces;
|
|
|
|
/// <summary>
|
|
/// Defines PDF digital-signing operations for the application boundary.
|
|
/// </summary>
|
|
public interface IPdfDigitalSignatureService
|
|
{
|
|
/// <summary>
|
|
/// Creates a digital signature for the provided PDF bytes and returns
|
|
/// a new signed PDF document.
|
|
/// </summary>
|
|
/// <param name="inputPdf">Source PDF content stream.</param>
|
|
/// <param name="outputPdf">Destination stream for signed PDF output.</param>
|
|
/// <param name="options">Optional signing options that map to PDF signature metadata fields.</param>
|
|
/// <param name="image">Optional image stream for signature appearance.</param>
|
|
/// <param name="cancellationToken">Cancellation token for cooperative cancellation.</param>
|
|
Task SignPdfAsync(Stream inputPdf, Stream outputPdf, PdfSignOptionsDto? options = null, Stream? image = null, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Checks whether the provided PDF contains signature field(s) and whether
|
|
/// those signatures are cryptographically valid.
|
|
/// </summary>
|
|
/// <param name="inputPdf">PDF content stream to inspect.</param>
|
|
/// <param name="cancellationToken">Cancellation token for cooperative cancellation.</param>
|
|
/// <returns>A structured result containing signature presence and per-signature details.</returns>
|
|
Task<PdfSignatureCheckResultDto> CheckPdfSignatureAsync(Stream inputPdf, CancellationToken cancellationToken = default);
|
|
}
|