Ice 3.7 C++11 API Reference
Public Member Functions | Static Public Member Functions | List of all members
IceSSL::OpenSSL::Certificate Class Referenceabstract

Encapsulates an OpenSSL X.509 certificate. More...

#include <IceSSL/IceSSL.h>

Inheritance diagram for IceSSL::OpenSSL::Certificate:
Inheritance graph
[legend]
Collaboration diagram for IceSSL::OpenSSL::Certificate:
Collaboration graph
[legend]

Public Member Functions

virtual x509_st * getCert () const =0
 Retrieve the native X509 certificate value wrapped by this object. More...
 
- Public Member Functions inherited from IceSSL::Certificate
virtual bool checkValidity () const =0
 Checks that the certificate is currently valid, that is, the current date falls between the validity period given in the certificate. More...
 
virtual bool checkValidity (const std::chrono::system_clock::time_point &t) const =0
 Checks that the certificate is valid at the given time. More...
 
virtual std::string encode () const =0
 Obtains a string encoding of the certificate in PEM format. More...
 
virtual std::vector< Ice::BytegetAuthorityKeyIdentifier () const =0
 Obtains the authority key identifier. More...
 
unsigned int getExtendedKeyUsage () const
 Returns the value of the extended key usage extension. More...
 
virtual std::vector< std::pair< int, std::string > > getIssuerAlternativeNames () const =0
 Obtains the values in the issuer's alternative names extension. More...
 
virtual DistinguishedName getIssuerDN () const =0
 Obtains the issuer's distinguished name (DN). More...
 
unsigned int getKeyUsage () const
 Returns the value of the key usage extension. More...
 
virtual std::chrono::system_clock::time_point getNotAfter () const =0
 Obtains the not-after validity time. More...
 
virtual std::chrono::system_clock::time_point getNotBefore () const =0
 Obtains the not-before validity time. More...
 
virtual std::string getSerialNumber () const =0
 Obtains the serial number. More...
 
virtual std::vector< std::pair< int, std::string > > getSubjectAlternativeNames () const =0
 See the comment for Plugin::getIssuerAlternativeNames. More...
 
virtual DistinguishedName getSubjectDN () const =0
 Obtains the subject's distinguished name (DN). More...
 
virtual std::vector< Ice::BytegetSubjectKeyIdentifier () const =0
 Obtains the subject key identifier. More...
 
virtual int getVersion () const =0
 Obtains the certificate version number. More...
 
virtual X509ExtensionPtr getX509Extension (const std::string &oid) const =0
 Obtains the extension with the given OID. More...
 
virtual std::vector< X509ExtensionPtrgetX509Extensions () const =0
 Obtains a list of the X509v3 extensions contained in the certificate. More...
 
virtual bool operator!= (const Certificate &) const =0
 Compares the certificates for equality using the native certificate comparison method. More...
 
virtual bool operator== (const Certificate &) const =0
 Compares the certificates for equality using the native certificate comparison method. More...
 
virtual std::string toString () const =0
 Stringifies the certificate. More...
 
virtual bool verify (const CertificatePtr &cert) const =0
 Verifies that this certificate was signed by the given certificate public key. More...
 

Static Public Member Functions

static CertificatePtr create (x509_st *cert)
 Construct a certificate using a native certificate. More...
 
static CertificatePtr decode (const std::string &cert)
 Decode a certificate from a string that uses the PEM encoding format. More...
 
static CertificatePtr load (const std::string &file)
 Load the certificate from a file. More...
 
- Static Public Member Functions inherited from IceSSL::Certificate
static CertificatePtr decode (const std::string &str)
 Decodes a certificate from a string that uses the PEM encoding format. More...
 
static CertificatePtr load (const std::string &file)
 Loads the certificate from a file. More...
 

Detailed Description

Encapsulates an OpenSSL X.509 certificate.

Member Function Documentation

◆ create()

static CertificatePtr IceSSL::OpenSSL::Certificate::create ( x509_st *  cert)
static

Construct a certificate using a native certificate.

The Certificate class assumes ownership of the given native certificate.

Parameters
certThe native certificate.
Returns
A new certificate object.

◆ decode()

static CertificatePtr IceSSL::OpenSSL::Certificate::decode ( const std::string &  cert)
static

Decode a certificate from a string that uses the PEM encoding format.

Parameters
certA string containing the PEM-encoded certificate.
Returns
A new certificate object.
Exceptions
CertificateEncodingExceptionif an error occurs.

◆ getCert()

virtual x509_st* IceSSL::OpenSSL::Certificate::getCert ( ) const
pure virtual

Retrieve the native X509 certificate value wrapped by this object.

Returns
The native certificate. The returned reference is only valid for the lifetime of this object. You can increment it with X509_dup.

◆ load()

static CertificatePtr IceSSL::OpenSSL::Certificate::load ( const std::string &  file)
static

Load the certificate from a file.

The certificate must use the PEM encoding format.

Parameters
fileThe certificate file.
Returns
A new certificate object.
Exceptions
CertificateReadExceptionif the file cannot be read.

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