THotPDF.SignPDFWithSystemCertificate Method

Enterprise edition: this feature ships with HotPDF Enterprise. Add HPDFEnterprise to a uses clause (C++Builder: #pragma link "HPDFEnterprise"); other editions keep the declaration and raise EHPDFEnterpriseRequired

Signs a PDF file or stream with a certificate selected from the Windows certificate store and writes the signed result to a separate destination

Declaration

class function SignPDFWithSystemCertificate(const InputPDFPath,
  OutputPDFPath: string; const Selector: THPDFCertificateStoreSelector;
  const Options: THPDFCMSSignOptions): boolean; overload; static;
class function SignPDFWithSystemCertificate(const InputPDFPath,
  OutputPDFPath: string; const Selector: THPDFCertificateStoreSelector;
  const Options: THPDFCMSSignOptions;
  CancellationToken: THPDFCancellationToken): boolean; overload; static;
class function SignPDFWithSystemCertificate(InputStream, OutputStream: TStream;
  const Selector: THPDFCertificateStoreSelector;
  const Options: THPDFCMSSignOptions): boolean; overload; static;
class function SignPDFWithSystemCertificate(InputStream, OutputStream: TStream;
  const Selector: THPDFCertificateStoreSelector;
  const Options: THPDFCMSSignOptions;
  CancellationToken: THPDFCancellationToken): boolean; overload; static;

Unit

HPDFDoc

Parameters

NamePurpose
InputPDFPathSource PDF file path
OutputPDFPathDestination path for the signed PDF
SelectorCertificate-store selector used to choose the signing certificate
OptionsCMS signing options controlling the digest, signature metadata, timestamp, and related policy
InputStreamSource stream positioned at the beginning of the PDF
OutputStreamDestination stream that receives the signed PDF
CancellationTokenOptional cooperative cancellation token honoured by the file and stream overloads that accept it

Return value

Returns True when the certificate is found and the signed PDF is written successfully

Usage notes

Related APIs