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-2023 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 
18 {
19 public:
20  //enums:
21  enum Type {
22  e_SHA1 = 0,
23  e_SHA256 = 1,
24  e_SHA384 = 2,
25  e_SHA512 = 3,
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
static std::vector< UChar > CalculateDigest(DigestAlgorithm::Type in_digest_algorithm_type, const std::vector< UChar > &in_message_buf)
TRN_UChar UChar
Definition: BasicTypes.h:12
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)