7#ifndef PDF_SIGNER_CMS_H
8#define PDF_SIGNER_CMS_H
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 PdfSignatureEncryption Encryption = PdfSignatureEncryption::RSA;
44 PdfHashingAlgorithm Hashing = PdfHashingAlgorithm::SHA256;
45 PdfSigningService SigningService;
46 nullable<std::chrono::seconds> SigningTimeUTC;
47 PdfSignedHashHandler SignedHashHandler;
48 PdfSignerCmsFlags Flags = PdfSignerCmsFlags::None;
87 void Reset()
override;
88 std::string GetSignatureFilter()
const override;
89 std::string GetSignatureSubFilter()
const override;
90 std::string GetSignatureType()
const override;
91 bool SkipBufferClear()
const override;
103 void ReserveAttributeSize(
unsigned attrSize);
106 const PdfSignerCmsParams& GetParameters()
const {
return m_parameters; }
109 void ensureEventBasedSigning();
110 void ensureDeferredSigning();
111 void checkContextInitialized();
112 void ensureContextInitialized();
118 std::unique_ptr<CmsContext> m_cmsContext;
120 PdfSignerCmsParams m_parameters;
121 unsigned m_reservedSize;
This class computes a CMS signature according to RFC 5652.
Definition PdfSignerCms.h:63
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:52
@ 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:27
@ ServiceDoWrapDigest
When supplying an external PdfSigningService, specify if the service should be called for a dry run.