Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
CACertificate Class Reference

Public Member Functions

 ~CACertificate ()
 
CACertificateclone () const
 
SINT32 encode (UINT8 *buff, UINT32 *bufflen, UINT32 type) const
 
SINT32 encode (DOMElement *&elemRoot, XERCES_CPP_NAMESPACE::DOMDocument *doc) const
 
SINT32 getRawSubjectKeyIdentifier (UINT8 *r_ski, UINT32 *r_skiLen)
 
SINT32 getAuthorityKeyIdentifier (UINT8 *r_aki, UINT32 *r_akiLen) const
 
SINT32 getSubjectKeyIdentifier (UINT8 *r_ski, UINT32 *r_skiLen)
 LERNGRUPPE Accessor method for the subjectKeyIdentifier (SKI) extension stored in this certificate. More...
 
SINT32 setSubjectKeyIdentifier (UINT8 *a_value, UINT32 a_valueLen)
 LERNGRUPPE Sets the subjectKeyIdentifier extension for this certificate to the given value. More...
 
SINT32 setSubjectKeyIdentifier ()
 LERNGRUPPE Sets the subjectKeyIdentifier extension for this certificate to the hash of the public key. More...
 
SINT32 verify (const CACertificate *a_cert) const
 
bool isValid () const
 

Static Public Member Functions

static CACertificatedecode (const UINT8 *const buff, UINT32 bufflen, UINT32 type, const char *const passwd=NULL)
 Extracts a certificate from an encoded (DER,XML) form. More...
 
static CACertificatedecode (const DOMNode *node, UINT32 type, const char *passwd=NULL)
 
static UINT8getXmlElementName ()
 
static SINT32 removeColons (const UINT8 *a_cSki, UINT32 a_cSkiLen, UINT8 *&r_ski, UINT32 *r_skiLen)
 LERNGRUPPE Removes the colons from the string representation of the given SKI. More...
 

Private Member Functions

 CACertificate ()
 
 CACertificate (X509 *x)
 
X509 * getX509 () const
 

Static Private Member Functions

static X509 * decode (const UINT8 **derX509, UINT32 derX509Len)
 

Private Attributes

X509 * m_pCert
 
ASN1_OCTET_STRING * m_pSKI
 
AUTHORITY_KEYID * m_pAKI
 

Static Private Attributes

static UINT8m_spXmlElementName =0
 

Friends

class CASignature
 
class CAASymCipher
 
class CASSLContext
 
class CATLSClientSocket
 

Constructor & Destructor Documentation

◆ ~CACertificate()

CACertificate::~CACertificate ( )

References m_pAKI, m_pCert, and m_pSKI.

◆ CACertificate() [1/2]

CACertificate::CACertificate ( )
private

References m_pAKI, m_pCert, and m_pSKI.

Referenced by clone(), and decode().

◆ CACertificate() [2/2]

CACertificate::CACertificate ( X509 *  x)
private

References m_pAKI, m_pCert, and m_pSKI.

Member Function Documentation

◆ clone()

CACertificate* CACertificate::clone ( ) const

◆ decode() [1/3]

CACertificate * CACertificate::decode ( const DOMNode *  node,
UINT32  type,
const char *  passwd = NULL 
)
static

◆ decode() [2/3]

static X509* CACertificate::decode ( const UINT8 **  derX509,
UINT32  derX509Len 
)
staticprivate

◆ decode() [3/3]

CACertificate * CACertificate::decode ( const UINT8 *const  buff,
UINT32  bufflen,
UINT32  type,
const char *const  passwd = NULL 
)
static

◆ encode() [1/2]

SINT32 CACertificate::encode ( DOMElement *&  elemRoot,
XERCES_CPP_NAMESPACE::DOMDocument *  doc 
) const

◆ encode() [2/2]

SINT32 CACertificate::encode ( UINT8 buff,
UINT32 bufflen,
UINT32  type 
) const

◆ getAuthorityKeyIdentifier()

SINT32 CACertificate::getAuthorityKeyIdentifier ( UINT8 r_aki,
UINT32 r_akiLen 
) const

◆ getRawSubjectKeyIdentifier()

SINT32 CACertificate::getRawSubjectKeyIdentifier ( UINT8 r_ski,
UINT32 r_skiLen 
)

◆ getSubjectKeyIdentifier()

SINT32 CACertificate::getSubjectKeyIdentifier ( UINT8 r_ski,
UINT32 r_skiLen 
)

LERNGRUPPE Accessor method for the subjectKeyIdentifier (SKI) extension stored in this certificate.

Returns
r_ski The SKI as colon-free string
r_skiLen The length of r_ski
Return values
E_SUCCESSupon successful retrieval
E_UNKNOWNotherwise

References E_SUCCESS, E_UNKNOWN, m_pSKI, CAMsg::printMsg(), removeColons(), and setSubjectKeyIdentifier().

Referenced by CACmdLnOptions::buildDefaultConfig(), CACmdLnOptions::getOperatorSubjectKeyIdentifier(), and CACmdLnOptions::setOwnCertificate().

◆ getX509()

X509* CACertificate::getX509 ( ) const
private

References m_pCert.

Referenced by CATLSClientSocket::doTLSConnect().

◆ getXmlElementName()

static UINT8* CACertificate::getXmlElementName ( )
static

References m_spXmlElementName.

◆ isValid()

bool CACertificate::isValid ( ) const

References m_pCert, and CAMsg::printMsg().

Referenced by verify().

◆ removeColons()

SINT32 CACertificate::removeColons ( const UINT8 a_cSkid,
UINT32  a_cSkidLen,
UINT8 *&  r_ski,
UINT32 r_skiLen 
)
static

LERNGRUPPE Removes the colons from the string representation of the given SKI.

Parameters
a_cSkidThe string from which the colons should be removed
a_cSkidLenThe length of a_cSkid
r_ski
r_skiLen
Returns
r_ski The SKI as colon-free string
r_skiLen The length of r_ski
Return values
E_SUCCESSupon successful removal
E_UNKNOWNotherwise

References E_SUCCESS, E_UNKNOWN, and CAMsg::printMsg().

Referenced by getAuthorityKeyIdentifier(), CAMultiSignature::getSKI(), and getSubjectKeyIdentifier().

◆ setSubjectKeyIdentifier() [1/2]

SINT32 CACertificate::setSubjectKeyIdentifier ( )

LERNGRUPPE Sets the subjectKeyIdentifier extension for this certificate to the hash of the public key.

Return values
E_SUCCESSupon successful removal
E_UNKNOWNotherwise

References len, and m_pCert.

Referenced by getRawSubjectKeyIdentifier(), and getSubjectKeyIdentifier().

◆ setSubjectKeyIdentifier() [2/2]

SINT32 CACertificate::setSubjectKeyIdentifier ( UINT8 a_value,
UINT32  a_valueLen 
)

LERNGRUPPE Sets the subjectKeyIdentifier extension for this certificate to the given value.

Parameters
a_valueThe value which should be set as SKI
a_valueLenThe length of a_value
Return values
E_SUCCESSupon successful removal
E_UNKNOWNotherwise

References E_SUCCESS, E_UNKNOWN, m_pCert, and m_pSKI.

◆ verify()

SINT32 CACertificate::verify ( const CACertificate a_cert) const

Friends And Related Function Documentation

◆ CAASymCipher

friend class CAASymCipher
friend

◆ CASignature

friend class CASignature
friend

◆ CASSLContext

friend class CASSLContext
friend

◆ CATLSClientSocket

friend class CATLSClientSocket
friend

Member Data Documentation

◆ m_pAKI

AUTHORITY_KEYID* CACertificate::m_pAKI
private

◆ m_pCert

X509* CACertificate::m_pCert
private

◆ m_pSKI

ASN1_OCTET_STRING* CACertificate::m_pSKI
private

◆ m_spXmlElementName

UINT8 * CACertificate::m_spXmlElementName =0
staticprivate

Referenced by getXmlElementName().