OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::OpenSSLPKI Namespace Reference

Namespaces

namespace  DH_private
 

Classes

class  CRL
 
class  CRLList
 
class  DH
 
class  PKey
 
class  X509
 
class  X509List
 
class  X509Store
 

Functions

static std::string x509_get_subject (::X509 *cert, bool new_format=false)
 
static std::string X509_get_pem_encoding (::X509 *cert)
 
static std::string x509_get_signature_algorithm (const ::X509 *cert)
 
static std::string x509_get_field (::X509 *cert, const int nid)
 
static std::string x509_get_serial (::X509 *cert)
 
static std::string x509_get_serial_hex (::X509 *cert)
 
static std::size_t x509_fingerprint_size ()
 
static std::vector< uint8_t > x509_get_fingerprint (const ::X509 *cert)
 

Function Documentation

◆ x509_fingerprint_size()

static std::size_t openvpn::OpenSSLPKI::x509_fingerprint_size ( )
inlinestatic

Retrieves the X.509 certificate SHA256 fingerprint as binary

Returns
Returns a uint8_t std:vector containing the binary representation of the certificate's SHA256 fingerprint.

Definition at line 237 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_field()

static std::string openvpn::OpenSSLPKI::x509_get_field ( ::X509 *  cert,
const int  nid 
)
inlinestatic

Retrieves a specific portion of the X.509 Certificate subject field

Parameters
certPointer to a native OpenSSL X509 object containing the certificate
nidSubject name ID to retrieve. See openssl/obj_mac.h for list of valid NID_* references.
Returns
Returns the contents of the extracted field on success. The resulting string may be empty if the extraction failed or the field is empty.

Definition at line 138 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_fingerprint()

static std::vector< uint8_t > openvpn::OpenSSLPKI::x509_get_fingerprint ( const ::X509 *  cert)
inlinestatic

Definition at line 242 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ X509_get_pem_encoding()

static std::string openvpn::OpenSSLPKI::X509_get_pem_encoding ( ::X509 *  cert)
inlinestatic

Definition at line 96 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_serial()

static std::string openvpn::OpenSSLPKI::x509_get_serial ( ::X509 *  cert)
inlinestatic

Retrieves the X.509 certificate serial number

Parameters
certPointer to a native OpenSSL X509 object containing the certificate
Returns
Returns the numeric representation of the certificate serial number as a std::string.

Definition at line 200 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_serial_hex()

static std::string openvpn::OpenSSLPKI::x509_get_serial_hex ( ::X509 *  cert)
inlinestatic

Retrieves the X.509 certificate serial number as hexadecimal

Parameters
certPointer to a native OpenSSL X509 object containing the certificate
Returns
Returns the hexadecimal representation of the certificate serial number as a std::string.

Definition at line 225 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_signature_algorithm()

static std::string openvpn::OpenSSLPKI::x509_get_signature_algorithm ( const ::X509 *  cert)
inlinestatic

Retrives the algorithm used to sign a X509 certificate

Parameters
certOpenSSL certificate
Returns

Definition at line 113 of file x509certinfo.hpp.

Here is the caller graph for this function:

◆ x509_get_subject()

static std::string openvpn::OpenSSLPKI::x509_get_subject ( ::X509 *  cert,
bool  new_format = false 
)
inlinestatic

Retrieve the complete X.509 Certificate Subject field

OpenSSL supports two ways of representing the subject line. The old format is deprecated, but there might be code expecting this old format. The old format looks like this:

/C=KG/ST=NA/O=OpenVPN-TEST/CN=Test-Server/emailAddress=me@myhost.mydomain

The new format is UTF-8 compliant and has a different formatting scheme:

C=KG, ST=NA, O=OpenVPN-TEST, CN=Test-Server,

emailAddress=me@my.nosp@m.host.nosp@m..mydo.nosp@m.main

Parameters
certPointer to a native OpenSSL X509 object containing the certificate
new_format(optional, default: false) Which format to use, true indicates the new format
Returns
Returns a std::string containing the complete certificate subject. If it was not possible to retrieve the subject, and empty string is returned.

Definition at line 56 of file x509certinfo.hpp.

Here is the caller graph for this function: