Table of Contents

Method SignAsync

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

SignAsync(byte[], PdfSigningOptions, CancellationToken)

Signs a PDF and returns the signed document.

public static Task<byte[]> SignAsync(byte[] input, PdfSigningOptions options, CancellationToken cancellationToken = default)

Parameters

input byte[]

The PDF to sign.

options PdfSigningOptions

Signing options; Certificate must carry a private key.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<byte[]>

The signed PDF.

SignAsync(string, string, PdfSigningOptions, CancellationToken)

Signs a PDF file and writes the signed document.

public static Task SignAsync(string inputPath, string outputPath, PdfSigningOptions options, CancellationToken cancellationToken = default)

Parameters

inputPath string

Path to the PDF to sign.

outputPath string

Path receiving the signed PDF; overwritten when it exists.

options PdfSigningOptions

Signing options; Certificate must carry a private key.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task

SignAsync(byte[], byte[], string, PdfSigningOptions, CancellationToken)

Signs a PDF with a PKCS#12 (PFX) bundle handled entirely by the managed engine: no operating-system key store is touched, which makes this the path for the browser (where platform crypto is unavailable) and for hosts that must not import keys. The bundle's extra certificates are embedded as the chain.

public static Task<byte[]> SignAsync(byte[] input, byte[] pkcs12File, string pkcs12Password, PdfSigningOptions options = null, CancellationToken cancellationToken = default)

Parameters

input byte[]

The PDF to sign.

pkcs12File byte[]

The PKCS#12 bundle carrying the signer's certificate and private key.

pkcs12Password string

The bundle password. Empty for none.

options PdfSigningOptions

Signing options. Certificate is ignored; null applies the defaults.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<byte[]>

The signed PDF.

Share