Class BatchSigner
- Namespace
- SimpleSign.PAdES.Signing
- Assembly
- SimpleSign.PAdES.dll
Signs multiple PDFs with one immutable PAdES configuration.
public sealed class BatchSigner : IAsyncDisposable
- Inheritance
-
BatchSigner
- Implements
- Inherited Members
Properties
AverageElapsedMs
Average terminal-operation time in milliseconds.
public double AverageElapsedMs { get; }
Property Value
FailureCount
Number of signing failures.
public int FailureCount { get; }
Property Value
SuccessCount
Number of successfully signed documents.
public int SuccessCount { get; }
Property Value
Methods
Create(X509Certificate2)
Creates a batch configuration for certificate.
public static BatchSigner.BatchSignerBuilder Create(X509Certificate2 certificate)
Parameters
certificateX509Certificate2
Returns
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
ResetMetrics()
Resets the batch metrics.
public void ResetMetrics()
SignAllAsync(IAsyncEnumerable<(string Id, byte[] PdfBytes)>, CancellationToken)
Signs inputs with bounded concurrency and yields results as operations complete.
public IAsyncEnumerable<BatchSignResult> SignAllAsync(IAsyncEnumerable<(string Id, byte[] PdfBytes)> inputs, CancellationToken cancellationToken = default)
Parameters
inputsIAsyncEnumerable<(string Id, byte[] PdfBytes)>cancellationTokenCancellationToken
Returns
Remarks
Results are completion-ordered rather than input-ordered. Disposing the asynchronous enumeration cancels pending work and the source enumeration through its cancellation token.
SignAsync(byte[], CancellationToken)
Signs one PDF and returns the result.
public Task<byte[]> SignAsync(byte[] pdfBytes, CancellationToken cancellationToken = default)
Parameters
pdfBytesbyte[]cancellationTokenCancellationToken
Returns
SignAsync(Stream, Stream, CancellationToken)
Signs one PDF into a caller-owned destination stream.
public Task SignAsync(Stream pdfStream, Stream outputStream, CancellationToken cancellationToken = default)
Parameters
pdfStreamStreamoutputStreamStreamcancellationTokenCancellationToken