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
optionsIOptions<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
tokenstringThe token of the challenge the client signed.
cancellationTokenCancellationTokenToken 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
signedDocumentReadOnlyMemory<byte>The signed PDF.
cancellationTokenCancellationTokenToken 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
certificateReadOnlyMemory<byte>The certificate, DER-encoded.
cancellationTokenCancellationTokenToken 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
requestDocumentSignatureRequestThe PDF and, optionally, the visible stamp of this signature.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DocumentSignatureChallenge>
The challenge the client signs and sends back.