PoDoFo  1.0.0-dev
Public Member Functions | List of all members
PoDoFo::PdfSignerCms Class Reference

This class computes a CMS signature according to RFC 5652. More...

#include <PdfSignerCms.h>

Inherits PoDoFo::PdfSigner.

Public Member Functions

 PdfSignerCms (const bufferview &cert, const bufferview &pkey, const PdfSignerCmsParams &parameters={ })
 Load X.509 certificate and supply a ASN.1 DER encoded private key. More...
 
 PdfSignerCms (const bufferview &cert, const PdfSignerCmsParams &parameters={ })
 Load a X.509 certificate without supplying a private key. More...
 
void AppendData (const bufferview &data) override
 
void ComputeSignature (charbuff &buffer, bool dryrun) override
 
void FetchIntermediateResult (charbuff &result) override
 
void ComputeSignatureDeferred (const bufferview &processedResult, charbuff &contents, bool dryrun) override
 
void Reset () override
 
std::string GetSignatureFilter () const override
 
std::string GetSignatureSubFilter () const override
 
std::string GetSignatureType () const override
 
bool SkipBufferClear () const override
 
void AddAttribute (const std::string_view &nid, const bufferview &attr, PdfSignatureAttributeFlags flags=PdfSignatureAttributeFlags::None)
 Add a signature attribute with given identifier from the input. More...
 
void ReserveAttributeSize (unsigned attrSize)
 Reserve some size in the final signature. More...
 
const PdfSignerCmsParams & GetParameters () const
 

Detailed Description

This class computes a CMS signature according to RFC 5652.

Constructor & Destructor Documentation

◆ PdfSignerCms() [1/2]

PdfSignerCms::PdfSignerCms ( const bufferview cert,
const bufferview pkey,
const PdfSignerCmsParams &  parameters = { } 
)

Load X.509 certificate and supply a ASN.1 DER encoded private key.

Parameters
certASN.1 DER encoded X.509 certificate
pkeyASN.1 DER encoded private key (PKCS#1 or PKCS#8) formats. It can be empty. In that case signing can be supplied by a signing service, or performing a deferred signing

◆ PdfSignerCms() [2/2]

PdfSignerCms::PdfSignerCms ( const bufferview cert,
const PdfSignerCmsParams &  parameters = { } 
)

Load a X.509 certificate without supplying a private key.

Parameters
certASN.1 DER encoded X.509 certificate
Remarks
signing can be supplied by a signing service, or performing a deferred signing

Member Function Documentation

◆ AddAttribute()

void PdfSignerCms::AddAttribute ( const std::string_view &  nid,
const bufferview attr,
PdfSignatureAttributeFlags  flags = PdfSignatureAttributeFlags::None 
)

Add a signature attribute with given identifier from the input.

Parameters
nidthe numerical identifier
attrthe attribute bytes. By default, the bytes are parsed for valid ASN.1 input

◆ ReserveAttributeSize()

void PdfSignerCms::ReserveAttributeSize ( unsigned  attrSize)

Reserve some size in the final signature.

It is used in dry-runs to enlarge the signature buffer

Remarks
the total reserved size is reset on Reset()

The documentation for this class was generated from the following files: