7#ifndef PDF_SIGNER_CMS_H
8#define PDF_SIGNER_CMS_H
18 typedef struct _xmlNode xmlNode;
19 typedef xmlNode* xmlNodePtr;
26 using PdfSigningService = std::function<void(
bufferview hashToSign,
bool dryrun, charbuff& signedHash)>;
27 using PdfSignedHashHandler = std::function<void(
bufferview signedhHash,
bool dryrun)>;
43 struct PODOFO_API PdfSignerCmsParams final
45 PdfSignatureType SignatureType = PdfSignatureType::PAdES_B;
46 [[deprecated(
"Encryption should be automatically detected from the public key in the certificate")]]
47 PdfSignatureEncryption Encryption = PdfSignatureEncryption::RSA;
48 PdfHashingAlgorithm Hashing = PdfHashingAlgorithm::SHA256;
49 PdfSigningService SigningService;
50 nullable<std::chrono::seconds> SigningTimeUTC;
51 PdfSignedHashHandler SignedHashHandler;
52 PdfSignerCmsFlags Flags = PdfSignerCmsFlags::None;
93 void AppendData(
const bufferview& data)
override;
97 void Reset()
override;
98 std::string GetSignatureFilter()
const override;
99 std::string GetSignatureSubFilter()
const override;
100 std::string GetSignatureType()
const override;
101 bool SkipBufferClear()
const override;
113 void ReserveAttributeSize(
unsigned attrSize);
116 const PdfSignerCmsParams& GetParameters()
const {
return m_parameters; }
123 void ensureEventBasedSigning();
124 void ensureDeferredSigning();
125 void checkContextInitialized();
126 void ensureContextInitialized();
133 std::unique_ptr<CmsContext> m_cmsContext;
135 PdfSignerCmsParams m_parameters;
136 unsigned m_reservedSize;
This class computes a CMS signature according to RFC 5652.
Definition PdfSignerCms.h:67
A context that can be used to customize the signing process.
Definition PdfSigningContext.h:72
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfSignatureAttributeFlags
Definition PdfSignerCms.h:56
@ SignedAttribute
The input is interpreted as a raw octet string.
@ None
Do not add a default appearrance.
cspan< char > bufferview
Convenient read-only char buffer span.
Definition basetypes.h:19
PdfSignerCmsFlags
Definition PdfSignerCms.h:30
@ ServiceDoWrapDigest
When supplying an external PdfSigningService, specify if the service should be called for a dry run.