PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfSigner.h
1// SPDX-FileCopyrightText: 2021 Francesco Pretto <ceztko@gmail.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef PDF_SIGNER_H
5#define PDF_SIGNER_H
6
7#include "PdfDeclarations.h"
8
9#include "PdfMemDocument.h"
10#include "PdfSignature.h"
11
12namespace PoDoFo
13{
14 class StreamDevice;
15
16 class PODOFO_API PdfSigner
17 {
18 public:
19 PdfSigner();
20 virtual ~PdfSigner();
21
26 virtual void Reset() = 0;
27
31 virtual void AppendData(const bufferview& data) = 0;
32
39 virtual void ComputeSignature(charbuff& contents, bool dryrun) = 0;
40
46 virtual void FetchIntermediateResult(charbuff& result);
47
56 virtual void ComputeSignatureDeferred(const bufferview& processedResult, charbuff& contents, bool dryrun);
57
60 virtual bool SkipBufferClear() const;
61
63 virtual std::string GetSignatureFilter() const;
64
66 virtual std::string GetSignatureSubFilter() const = 0;
67
69 virtual std::string GetSignatureType() const = 0;
70
73 virtual unsigned GetSignerIdentityCount() const;
74
77 virtual void UnpackIntermediateResult(const bufferview& processedResult, unsigned signerIdx, charbuff& result);
78
81 virtual void AssembleProcessedResult(const bufferview& processedResult, unsigned signerIdx, charbuff& result);
82
83 private:
84 PdfSigner(const PdfSigner&) = delete;
85 PdfSigner& operator=(const PdfSigner&) = delete;
86 };
87
94 PODOFO_API void SignDocument(PdfMemDocument& doc, StreamDevice& device, PdfSigner& signer,
95 PdfSignature& signature, PdfSaveOptions saveOptions = PdfSaveOptions::None);
96}
97
98#endif // PDF_SIGNER_H
This file should be included as the FIRST file in every header of PoDoFo lib.
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PODOFO_API void SignDocument(PdfMemDocument &doc, StreamDevice &device, PdfSigner &signer, PdfSignature &signature, PdfSaveOptions saveOptions=PdfSaveOptions::None)
Sign the document on the given signature field.
Definition PdfSigner.cpp:42
PdfSaveOptions
Definition PdfDeclarations.h:429