6 #ifndef PDFTRON_H_CPPPDFDigitalSignatureField
7 #define PDFTRON_H_CPPPDFDigitalSignatureField
8 #include <C/PDF/TRN_DigitalSignatureField.h>
9 #include <C/PDF/TRN_VerificationResult.h>
23 namespace pdftron {
namespace PDF {
476 const bool in_make_mandatory =
true);
488 const UInt32 in_contents_size_to_reserve);
500 const UInt32 in_contents_size_to_reserve);
534 const std::vector<UChar>& in_digest,
535 const UString& in_pkcs12_keyfile_path,
536 const UString& in_keyfile_password,
537 const bool in_pades_mode,
557 const std::vector<UChar>& in_digest,
558 const std::vector<UChar>& in_pkcs12_buffer,
559 const UString& in_keyfile_password,
560 const bool in_pades_mode,
581 const UChar* in_digest,
582 const size_t in_digest_size,
583 const UString& in_pkcs12_keyfile_path,
584 const UString& in_keyfile_password,
585 const bool in_pades_mode,
607 const UChar* in_digest,
608 const size_t in_digest_size,
609 const UChar* in_pkcs12_buffer,
610 const size_t in_pkcs12_buffer_size,
611 const UString& in_keyfile_password,
612 const bool in_pades_mode,
654 const std::vector<UChar>& in_digest_buf,
655 const std::vector<UChar>& in_custom_signedattributes_buf = std::vector<UChar>());
674 const UChar* in_digest_buf,
675 const size_t in_digest_buf_size,
676 const UChar* in_custom_signedattributes_buf = NULL,
677 const size_t in_custom_signedattributes_buf_size = 0);
696 const std::vector<Crypto::X509Certificate>& in_chain_certs_list,
699 const std::vector<UChar>& in_signature_value_buf,
700 const std::vector<UChar>& in_signedattributes_buf);
722 const size_t in_chain_certs_list_size,
725 const UChar* in_signature_value_buf,
726 const size_t in_signature_value_buf_size,
727 const UChar* in_signedattributes_buf,
728 const size_t in_signedattributes_buf_size);
748 const std::vector<Crypto::X509Certificate>& chain_certs_list,
751 const std::vector<UChar>& signature_value_buf,
752 const std::vector<UChar>& signedattributes_buf,
776 const size_t chain_certs_list_size,
779 const UChar* signature_value_buf,
780 const size_t signature_value_buf_size,
781 const UChar* signedattributes_buf,
782 const size_t signedattributes_buf_size,
800 TRN_DigitalSignatureField m_impl;
805 #include <Impl/DigitalSignatureField.inl>
810 #endif //PDFTRON_H_CPPPDFDigitalSignatureField
DigitalSignatureField & operator=(const DigitalSignatureField &other)
bool HasCryptographicSignature() const
void CreateSigDictForCustomSigning(const UString &in_filter_name, const SubFilterType &in_subfilter_type, const UInt32 in_contents_size_to_reserve)
SDF::Obj GetSDFObj() const
void SetPreferredDigestAlgorithm(Crypto::DigestAlgorithm::Type in_digest_algorithm_type, const bool in_make_mandatory=true)
UString GetReason() const
void UseSubFilter(const SubFilterType in_subfilter_type, const bool in_make_mandatory=true)
DocumentPermissions GetDocumentPermissions() const
void CertifyOnNextSave(const UString &in_pkcs12_keyfile_path, const UString &in_password)
static std::vector< UChar > GenerateCMSSignature(const Crypto::X509Certificate &in_signer_cert, const std::vector< Crypto::X509Certificate > &in_chain_certs_list, const Crypto::ObjectIdentifier &in_digest_algorithm_oid, const Crypto::ObjectIdentifier &in_signature_algorithm_oid, const std::vector< UChar > &in_signature_value_buf, const std::vector< UChar > &in_signedattributes_buf)
size_t SignatureHandlerId
void SetFieldPermissions(const FieldPermissions in_action, const std::vector< UString > &in_field_names_list=std::vector< UString >())
static bool SetDigSigLogFilename(const UString &filename)
void TimestampOnNextSave(const TimestampingConfiguration &in_timestamping_config, const VerificationOptions &in_timestamp_response_verification_options)
UString GetContactInfo() const
static std::vector< UChar > SignDigest(const std::vector< UChar > &in_digest, const UString &in_pkcs12_keyfile_path, const UString &in_keyfile_password, const bool in_pades_mode, const Crypto::DigestAlgorithm::Type in_digest_algorithm_type)
void CreateSigDictForCustomCertification(const UString &in_filter_name, const SubFilterType &in_subfilter_type, const UInt32 in_contents_size_to_reserve)
void SetLocation(const UString &in_location)
std::vector< UString > GetLockedFields() const
bool EnableLTVOfflineVerification(const VerificationResult &in_verification_result) const
void SignOnNextSave(const UString &in_pkcs12_keyfile_path, const UString &in_password)
Crypto::X509Certificate GetSignerCertFromCMS() const
void CertifyOnNextSaveWithCustomHandler(const SDF::SignatureHandlerId in_signature_handler_id)
void SetSigDictTimeOfSigning(const PDF::Date &in_date)
VerificationResult Verify(const VerificationOptions &in_opts) const
UString GetSignatureName() const
bool IsCertification() const
void SetReason(const UString &in_reason)
UInt32 GetCertCount() const
Date GetSigningTime() const
void SetDocumentPermissions(DocumentPermissions in_perms)
std::vector< Common::ByteRange > GetByteRanges() const
TimestampingResult GenerateContentsWithEmbeddedTimestamp(const TimestampingConfiguration &in_timestamping_config, const VerificationOptions &in_timestamp_response_verification_options)
UString GetLocation() const
void SetContactInfo(const UString &in_contact_info)
static std::vector< UChar > GenerateESSSigningCertPAdESAttribute(const Crypto::X509Certificate &in_signer_cert, const Crypto::DigestAlgorithm::Type in_digest_algorithm_type)
std::vector< std::vector< Crypto::X509Certificate > > GetCertPathsFromCMS() const
static std::vector< UChar > GenerateCMSSignedAttributes(const std::vector< UChar > &in_digest_buf, const std::vector< UChar > &in_custom_signedattributes_buf=std::vector< UChar >())
void SignOnNextSaveWithCustomHandler(const SDF::SignatureHandlerId in_signature_handler_id)
DigitalSignatureField(const DigitalSignatureField &other)
std::vector< UChar > GetCert(UInt32 in_index) const
bool IsLockedByDigitalSignature() const
SubFilterType GetSubFilter() const
bool HasVisibleAppearance() const
std::vector< UChar > CalculateDigest(const Crypto::DigestAlgorithm::Type in_digest_algorithm_type=Crypto::DigestAlgorithm::e_SHA256) const