Table of Contents

Class RestPkiDocumentSigner

Namespace
NuvTools.Security.Certificate.Lacuna
Assembly
NuvTools.Security.Certificate.Lacuna.dll

Signs PDFs (PAdES) through Lacuna REST PKI. The client signs the challenge in the browser with Web PKI (signWithRestPki); reading certificates, preparing the document and completing the signature all happen on the service, so no key or licence is kept locally.

public sealed class RestPkiDocumentSigner : IDocumentSigner
Inheritance
RestPkiDocumentSigner
Implements
Inherited Members

Constructors

RestPkiDocumentSigner(IOptions<RestPkiOptions>)

Signs PDFs (PAdES) through Lacuna REST PKI. The client signs the challenge in the browser with Web PKI (signWithRestPki); reading certificates, preparing the document and completing the signature all happen on the service, so no key or licence is kept locally.

public RestPkiDocumentSigner(IOptions<RestPkiOptions> options)

Parameters

options IOptions<RestPkiOptions>

REST PKI configuration.

Methods

CompleteAsync(string, CancellationToken)

Completes the signature the client signed the challenge for.

public Task<SignedDocument> CompleteAsync(string token, CancellationToken cancellationToken = default)

Parameters

token string

The token of the challenge the client signed.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<SignedDocument>

The signed PDF and the certificate it was actually signed with.

GetSignersAsync(ReadOnlyMemory<byte>, CancellationToken)

Reads the certificates a document was already signed with, without validating the signatures.

public Task<IReadOnlyList<CertificateDetails>> GetSignersAsync(ReadOnlyMemory<byte> signedDocument, CancellationToken cancellationToken = default)

Parameters

signedDocument ReadOnlyMemory<byte>

The signed PDF.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<IReadOnlyList<CertificateDetails>>

One entry per signature, in the order the provider reports them. Document timestamps are left out.

ReadCertificateAsync(ReadOnlyMemory<byte>, CancellationToken)

Reads who a certificate was issued to, without validating it.

public Task<CertificateDetails> ReadCertificateAsync(ReadOnlyMemory<byte> certificate, CancellationToken cancellationToken = default)

Parameters

certificate ReadOnlyMemory<byte>

The certificate, DER-encoded.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<CertificateDetails>

What the certificate says about its holder and issuer.

StartAsync(DocumentSignatureRequest, CancellationToken)

Prepares the document for signing and opens the challenge the client signs.

public Task<DocumentSignatureChallenge> StartAsync(DocumentSignatureRequest request, CancellationToken cancellationToken = default)

Parameters

request DocumentSignatureRequest

The PDF and, optionally, the visible stamp of this signature.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<DocumentSignatureChallenge>

The challenge the client signs and sends back.