4#ifndef PDF_SIGNER_CMS_H
5#define PDF_SIGNER_CMS_H
15 typedef struct _xmlNode xmlNode;
16 typedef xmlNode* xmlNodePtr;
23 using PdfSigningService = std::function<void(
bufferview hashToSign,
bool dryrun, charbuff& signedHash)>;
24 using PdfSignedHashHandler = std::function<void(
bufferview signedhHash,
bool dryrun)>;
40 struct PODOFO_API PdfSignerCmsParams final
42 PdfSignatureType SignatureType = PdfSignatureType::PAdES_B;
43 [[deprecated(
"Encryption should be automatically detected from the public key in the certificate")]]
44 PdfSignatureEncryption Encryption = PdfSignatureEncryption::RSA;
45 PdfHashingAlgorithm Hashing = PdfHashingAlgorithm::SHA256;
46 PdfSigningService SigningService;
47 nullable<std::chrono::seconds> SigningTimeUTC;
48 PdfSignedHashHandler SignedHashHandler;
49 PdfSignerCmsFlags Flags = PdfSignerCmsFlags::None;
90 void AppendData(
const bufferview& data)
override;
94 void Reset()
override;
95 std::string GetSignatureFilter()
const override;
96 std::string GetSignatureSubFilter()
const override;
97 std::string GetSignatureType()
const override;
98 bool SkipBufferClear()
const override;
110 void ReserveAttributeSize(
unsigned attrSize);
113 unsigned GetSignedHashSize()
const;
115 const PdfSignerCmsParams& GetParameters()
const {
return m_parameters; }
122 void ensureEventBasedSigning();
123 void ensureDeferredSigning();
124 void checkContextInitialized();
125 void ensureContextInitialized();
132 std::unique_ptr<CmsContext> m_cmsContext;
134 PdfSignerCmsParams m_parameters;
135 unsigned m_reservedSize;
This class computes a CMS signature according to RFC 5652.
Definition PdfSignerCms.h:64
A context that can be used to customize the signing process.
Definition PdfSigningContext.h:69
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfSignatureAttributeFlags
Definition PdfSignerCms.h:53
@ SignedAttribute
The input is interpreted as a raw octet string.
@ None
Do not add a default appearance.
cspan< char > bufferview
Convenient read-only char buffer span.
Definition basetypes.h:16
PdfSignerCmsFlags
Definition PdfSignerCms.h:27
@ ServiceDoWrapDigest
When supplying an external PdfSigningService, specify if the service should be called for a dry run.