Table of Contents

Class DeferredSigningSession

Namespace
SimpleSign.PAdES.Signing
Assembly
SimpleSign.PAdES.dll

Serializable state for a deferred (two-phase) signing operation. Created by PrepareAsync(byte[], X509Certificate2, DeferredSigningOptions?, ILogger?, CancellationToken) and consumed by CompleteAsync(byte[], byte[], DeferredSigningCompleteOptions?, ILogger?, CancellationToken). Store this in Redis, a database, or any persistent storage between HTTP requests.

public sealed class DeferredSigningSession
Inheritance
DeferredSigningSession
Inherited Members

Properties

ByteRangeLength1

Length of the first byte range.

public required long ByteRangeLength1 { get; init; }

Property Value

long

ByteRangeLength2

Length of the second byte range.

public required long ByteRangeLength2 { get; init; }

Property Value

long

ByteRangeOffset1

Start offset of the first byte range (always 0 for PAdES).

public required long ByteRangeOffset1 { get; init; }

Property Value

long

ByteRangeOffset2

Start offset of the second byte range.

public required long ByteRangeOffset2 { get; init; }

Property Value

long

CertificateDer

DER-encoded signer certificate (public key only).

public required byte[] CertificateDer { get; init; }

Property Value

byte[]

ContentsHexOffset

Byte offset where the hex-encoded CMS should be written.

public required long ContentsHexOffset { get; init; }

Property Value

long

ContentsReservedBytes

Number of bytes reserved for the CMS (half the hex character count).

public required int ContentsReservedBytes { get; init; }

Property Value

int

DigestOid

Digest algorithm OID (e.g., "2.16.840.1.101.3.4.2.1" for SHA-256).

public required string DigestOid { get; init; }

Property Value

string

ExtraCertificatesDer

DER-encoded extra certificates (chain). Null if no chain was provided.

public byte[][]? ExtraCertificatesDer { get; init; }

Property Value

byte[][]

PreparedPdf

The prepared PDF bytes with signature placeholder.

public required byte[] PreparedPdf { get; init; }

Property Value

byte[]

SigDictObjectNumber

PDF object number of the signature dictionary.

public required int SigDictObjectNumber { get; init; }

Property Value

int

SignatureAlgorithmOid

Signature algorithm OID (e.g., "1.2.840.113549.1.1.11" for RSA-SHA256).

public required string SignatureAlgorithmOid { get; init; }

Property Value

string

SignedAttributes

DER-encoded signed attributes — the data that was (or will be) signed externally.

public required byte[] SignedAttributes { get; init; }

Property Value

byte[]

SigningTime

UTC signing time embedded in the signed attributes.

public required DateTimeOffset SigningTime { get; init; }

Property Value

DateTimeOffset

Methods

Deserialize(byte[])

Deserializes a session from a byte array.

public static DeferredSigningSession Deserialize(byte[] data)

Parameters

data byte[]

Returns

DeferredSigningSession

Deserialize(ReadOnlySpan<byte>)

Deserializes a session from a read-only span.

public static DeferredSigningSession Deserialize(ReadOnlySpan<byte> data)

Parameters

data ReadOnlySpan<byte>

Returns

DeferredSigningSession

Serialize()

Serializes this session to a byte array for storage (JSON UTF-8).

public byte[] Serialize()

Returns

byte[]