Class PadesSigner
- Namespace
- SimpleSign.PAdES
- Assembly
- SimpleSign.PAdES.dll
Main entry point for PAdES signing of PDF documents.
public sealed class PadesSigner
- Inheritance
-
PadesSigner
- Inherited Members
Examples
PadesSigningResult result = await PadesSigner
.Document(pdfBytes)
.WithCertificate(myCertificate)
.WithLevel(AdesBaselineProfile.Timestamped(
new TimestampOptions(new Uri("https://tsa.example.com"))))
.SignWithDetailsAsync();
Methods
Document(byte[])
Starts the signing pipeline from a byte array.
public static PadesSignerBuilder Document(byte[] pdfBytes)
Parameters
pdfBytesbyte[]The input PDF bytes. The array is copied; the caller may mutate it afterwards.
Returns
- PadesSignerBuilder
A new PadesSignerBuilder with default configuration.
Exceptions
- ArgumentNullException
pdfBytesis null.
Document(Stream)
Starts the signing pipeline from a seekable stream.
public static PadesSignerBuilder Document(Stream pdfStream)
Parameters
pdfStreamStreamThe input PDF stream. Must be seekable and readable.
Returns
- PadesSignerBuilder
A new PadesSignerBuilder with default configuration.
Remarks
The stream is retained by the builder. A builder created from a stream is single-execution: it seeks the stream during signing and is not safe for concurrent terminal calls.
Exceptions
- ArgumentNullException
pdfStreamis null.- ArgumentException
pdfStreamis not seekable.
DocumentAsync(string, CancellationToken)
Starts the signing pipeline from a file path (async file I/O).
public static Task<PadesSignerBuilder> DocumentAsync(string pdfPath, CancellationToken cancellationToken = default)
Parameters
pdfPathstringPath to the input PDF file.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<PadesSignerBuilder>
A new PadesSignerBuilder with default configuration.
Exceptions
- ArgumentException
pdfPathis null or whitespace.