CryptoFramework
Public Member Functions | List of all members
ICertificate Class Referenceabstract

Interface representing a digital certificate. More...

#include <ICertificate.hpp>

Public Member Functions

virtual ~ICertificate ()=default
 Virtual destructor for the ICertificate interface. More...
 
virtual Blob Encrypt (const Blob &data) const =0
 Encrypts the provided data. More...
 
virtual Blob Decrypt (const Blob &encrypted_data) const =0
 Decrypts the provided encrypted data. More...
 
virtual Blob SignCades (const Blob &data, CadesType type, bool detached, const std::wstring &tsp_server_url=L"") const =0
 Signs the provided data using the CAdES format. More...
 
virtual std::string GetSubjectName () const =0
 Retrieves the subject name of the certificate. More...
 

Detailed Description

Interface representing a digital certificate.

The ICertificate interface defines methods for encryption, decryption, signing data using CAdES (CMS Advanced Electronic Signatures), and retrieving certificate information.

Constructor & Destructor Documentation

◆ ~ICertificate()

virtual ICertificate::~ICertificate ( )
virtualdefault

Virtual destructor for the ICertificate interface.

Ensures proper cleanup of derived class objects through the interface.

Member Function Documentation

◆ Decrypt()

virtual Blob ICertificate::Decrypt ( const Blob encrypted_data) const
pure virtual

Decrypts the provided encrypted data.

Decrypts the input Blob data using the certificate's private key.

Parameters
encrypted_dataThe Blob containing the data to be decrypted.
Returns
The decrypted data as a Blob.

◆ Encrypt()

virtual Blob ICertificate::Encrypt ( const Blob data) const
pure virtual

Encrypts the provided data.

Encrypts the input Blob data using the certificate's public key.

Parameters
dataThe Blob containing the data to be encrypted.
Returns
The encrypted data as a Blob.

◆ GetSubjectName()

virtual std::string ICertificate::GetSubjectName ( ) const
pure virtual

Retrieves the subject name of the certificate.

Returns the subject name (distinguished name) associated with the certificate.

Returns
The subject name of the certificate.

◆ SignCades()

virtual Blob ICertificate::SignCades ( const Blob data,
CadesType  type,
bool  detached,
const std::wstring &  tsp_server_url = L"" 
) const
pure virtual

Signs the provided data using the CAdES format.

Generates a CAdES signature for the input data, with the option to create an attached or detached signature. Additionally, a Time-Stamp Protocol (TSP) server URL can be provided for timestamping the signature.

Parameters
dataThe Blob containing the data to be signed.
typeThe type of CAdES signature (e.g., CadesType::kBes).
detachedA boolean indicating whether the signature is detached (true) or attached (false).
tsp_server_urlAn optional URL of the TSP server to include a trusted timestamp in the signature. If not provided, timestamping will not be performed.
Returns
The generated signature as a Blob.

The documentation for this class was generated from the following file: