Table of Contents

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

double

FailureCount

Number of signing failures.

public int FailureCount { get; }

Property Value

int

SuccessCount

Number of successfully signed documents.

public int SuccessCount { get; }

Property Value

int

Methods

Create(X509Certificate2)

Creates a batch configuration for certificate.

public static BatchSigner.BatchSignerBuilder Create(X509Certificate2 certificate)

Parameters

certificate X509Certificate2

Returns

BatchSigner.BatchSignerBuilder

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

inputs IAsyncEnumerable<(string Id, byte[] PdfBytes)>
cancellationToken CancellationToken

Returns

IAsyncEnumerable<BatchSignResult>

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

pdfBytes byte[]
cancellationToken CancellationToken

Returns

Task<byte[]>

SignAsync(Stream, Stream, CancellationToken)

Signs one PDF into a caller-owned destination stream.

public Task SignAsync(Stream pdfStream, Stream outputStream, CancellationToken cancellationToken = default)

Parameters

pdfStream Stream
outputStream Stream
cancellationToken CancellationToken

Returns

Task