using EnvelopeGenerator.Application.Common.Dto; namespace EnvelopeGenerator.Application.Common.Interfaces.Services; /// /// Defines PDF digital-signing operations for the application boundary. /// public interface IPdfDigitalSignatureService { /// /// Creates a digital signature for the provided PDF bytes and returns /// a new signed PDF document. /// /// Source PDF content as a byte array. /// Optional signing options that map to PDF signature metadata fields. /// Cancellation token for cooperative cancellation. /// The signed PDF as a byte array. Task SignPdfAsync(byte[] pdfBytes, PdfSignOptionsDto? options = null, CancellationToken cancellationToken = default); /// /// Applies multiple signatures to the provided PDF in sequence and returns /// the final signed PDF document. /// /// Source PDF content as a byte array. /// Ordered signing options; one signature is applied per item. /// Cancellation token for cooperative cancellation. /// The signed PDF as a byte array. Task SignPdfAsync(byte[] pdfBytes, IReadOnlyList optionsList, CancellationToken cancellationToken = default); /// /// Checks whether the provided PDF contains signature field(s) and whether /// those signatures are cryptographically valid. /// /// PDF content to inspect. /// Cancellation token for cooperative cancellation. /// A structured result containing signature presence and per-signature details. Task CheckPdfSignatureAsync(byte[] pdfBytes, CancellationToken cancellationToken = default); /// /// Extracts the original signed revision from a signed PDF. /// For multi-revision files this returns the first signed revision bytes. /// /// Signed PDF bytes. /// Cancellation token for cooperative cancellation. /// PDF bytes of the original signed revision. Task ExtractOriginalPdfAsync(byte[] pdfBytes, CancellationToken cancellationToken = default); }