- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DigestAlgorithm.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5
6 #ifndef PDFTRON_H_CPPPDFDigestAlgorithm
7 #define PDFTRON_H_CPPPDFDigestAlgorithm
8 #include <C/Crypto/TRN_DigestAlgorithm.h>
9
10 #include <Common/BasicTypes.h>
11 #include <Common/UString.h>
12 #include <PDF/PDFDoc.h>
13
14 namespace pdftron { namespace Crypto {
15
16
17 class DigestAlgorithm
18 {
19 public:
20 //enums:
21 enum Type {
22 e_SHA1 = 0,
23 e_SHA256 = 1,
24 e_SHA384 = 2,
25 e_SHA512 = 3,
26 e_RIPEMD160 = 4,
27 e_unknown_digest_algorithm = 5
28 };
29
37 static std::vector<UChar> CalculateDigest(DigestAlgorithm::Type in_digest_algorithm_type, const std::vector<UChar>& in_message_buf);
38
48 static std::vector<UChar> SignDigest(const std::vector<UChar>& digest_buf, const DigestAlgorithm::Type digest_algorithm_type, const UString pkcs12_keyfile_path, const UString pkcs12_password);
49
59 static std::vector<UChar> SignDigest(const std::vector<UChar>& digest_buf, const DigestAlgorithm::Type digest_algorithm_type, const std::vector<UChar>& pkcs12_buf, const UString pkcs12_password);
60 #ifndef SWIG
61
69 static std::vector<UChar> CalculateDigest(DigestAlgorithm::Type in_digest_algorithm_type, const UChar* in_message_buf, const size_t in_message_buf_size);
70
81 static std::vector<UChar> SignDigest(const UChar* digest_buf, const size_t digest_buf_size, const DigestAlgorithm::Type digest_algorithm_type, const UString pkcs12_keyfile_path, const UString pkcs12_password);
82
94 static std::vector<UChar> SignDigest(const UChar* digest_buf, const size_t digest_buf_size, const DigestAlgorithm::Type digest_algorithm_type, const UChar* pkcs12_buf, const size_t pkcs12_buf_size, const UString pkcs12_password);
95 #endif
96 };
97
98 #include <Impl/DigestAlgorithm.inl>
99 } //end Crypto
100 } //end pdftron
101
102
103 #endif //PDFTRON_H_CPPPDFDigestAlgorithm
pdftron::Crypto::DigestAlgorithm::e_RIPEMD160
Definition: DigestAlgorithm.h:26
pdftron::Crypto::DigestAlgorithm::e_SHA512
Definition: DigestAlgorithm.h:25
UString.h
pdftron::Crypto::DigestAlgorithm::e_unknown_digest_algorithm
Definition: DigestAlgorithm.h:27
pdftron::Crypto::DigestAlgorithm::CalculateDigest
static std::vector< UChar > CalculateDigest(DigestAlgorithm::Type in_digest_algorithm_type, const std::vector< UChar > &in_message_buf)
pdftron::Crypto::DigestAlgorithm::e_SHA256
Definition: DigestAlgorithm.h:23
pdftron::Crypto::DigestAlgorithm::e_SHA384
Definition: DigestAlgorithm.h:24
pdftron::Crypto::DigestAlgorithm
Definition: DigestAlgorithm.h:17
pdftron::UChar
TRN_UChar UChar
Definition: BasicTypes.h:12
pdftron::Crypto::DigestAlgorithm::SignDigest
static std::vector< UChar > SignDigest(const std::vector< UChar > &digest_buf, const DigestAlgorithm::Type digest_algorithm_type, const UString pkcs12_keyfile_path, const UString pkcs12_password)
PDFDoc.h
BasicTypes.h
pdftron::UString
Definition: UString.h:27
pdftron::Crypto::DigestAlgorithm::Type
Type
Definition: DigestAlgorithm.h:21
pdftron::Crypto::DigestAlgorithm::e_SHA1
Definition: DigestAlgorithm.h:22