Table of Contents

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

pdfBytes byte[]

The input PDF bytes. The array is copied; the caller may mutate it afterwards.

Returns

PadesSignerBuilder

A new PadesSignerBuilder with default configuration.

Exceptions

ArgumentNullException

pdfBytes is null.

Document(Stream)

Starts the signing pipeline from a seekable stream.

public static PadesSignerBuilder Document(Stream pdfStream)

Parameters

pdfStream Stream

The 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

pdfStream is null.

ArgumentException

pdfStream is 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

pdfPath string

Path to the input PDF file.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<PadesSignerBuilder>

A new PadesSignerBuilder with default configuration.

Exceptions

ArgumentException

pdfPath is null or whitespace.