API Documentation for Signer

NoPoDoFo Signer

This class is a wrapper for the classes necessary to execute and apply a signature to the document. NoPoDoFo currently supports PKCS7 (adbe-pkcs7-detached) signature only. Please see the Signer Cookbook for an example.

class Signer {
  signatureField: SignatureField

  constructor(doc: Document, output?: string)

    loadCertificateAndKey(certificate: string | Buffer, opts?: { password?: string, pKey?: string | Buffer }, cb?: Callback<Number>): void
  write(minSignatureSize: Number, cb: Callback<Buffer | string>): void
}

Constructors


constructor(doc: Document, output?: string)

Create a new instance of a NoPoDoFo Signer. The Signer is the only means of signing a document.

Properties


signatureField

The page Annotation used to store the signature.

Methods


loadCertificateAndKey

Loads the Certificate and Private Key and stores the values into the Signer instance. Values are not retrievable but are stored for use on Signer.write method invocation. After both cert and pkey are loaded, a minimal signature size is calculated and returned to the caller. To complete the signing process this minimum signature size value needs to be provided to the write method.

loadCertificateAndKey(certificate: string | Buffer, opts?: { password?: string, pKey?: string | Buffer }, cb?: Callback<Number>): void

write

Signs the document output to disk or a node buffer. The loadCertificateAndKey must be loaded prior to calling write

write(minSignatureSize: Number, cb: Callback<Buffer | string>): void

results matching ""

    No results matching ""