PcapPlusPlus  Next
pcpp::X509Internal::X509Certificate Class Reference

#include <X509Decoder.h>

Public Member Functions

X509TBSCertificate getTbsCertificate () const
 
X509AlgorithmIdentifier getSignatureAlgorithm () const
 
X509Key getSignature () const
 
Asn1SequenceRecordgetAsn1Root () const
 
std::vector< uint8_t > encode ()
 

Static Public Member Functions

static std::unique_ptr< X509Certificatedecode (const uint8_t *data, size_t dataLen)
 

Detailed Description

Internal class for handling X.509 certificate parsing and encoding

Member Function Documentation

◆ decode()

static std::unique_ptr<X509Certificate> pcpp::X509Internal::X509Certificate::decode ( const uint8_t *  data,
size_t  dataLen 
)
static

Decodes an X.509 certificate from binary data

Parameters
[in]dataPointer to the binary certificate data
[in]dataLenLength of the binary data
Returns
A unique_ptr to the decoded X509Certificate, or nullptr on failure

◆ encode()

std::vector<uint8_t> pcpp::X509Internal::X509Certificate::encode ( )

Encodes the certificate to binary DER format

Returns
A vector containing the DER-encoded certificate

◆ getAsn1Root()

Asn1SequenceRecord* pcpp::X509Internal::X509Certificate::getAsn1Root ( ) const

Gets the root ASN.1 record of the certificate

Returns
Pointer to the root ASN.1 sequence record

◆ getSignature()

X509Key pcpp::X509Internal::X509Certificate::getSignature ( ) const

Gets the signature value from the certificate

Returns
The X509Key containing the signature

◆ getSignatureAlgorithm()

X509AlgorithmIdentifier pcpp::X509Internal::X509Certificate::getSignatureAlgorithm ( ) const

Gets the signature algorithm used to sign the certificate

Returns
The X509AlgorithmIdentifier for the signature

◆ getTbsCertificate()

X509TBSCertificate pcpp::X509Internal::X509Certificate::getTbsCertificate ( ) const

Gets the TBS (To Be Signed) portion of the certificate

Returns
The X509TBSCertificate containing the TBS data