Wt
4.11.0
|
An interface to an SSL certificate. More...
#include <Wt/WSslCertificate.h.C>
Classes | |
class | DnAttribute |
Distinguished name attribute (also known as relative distinguished name) More... | |
Public Types | |
enum | DnAttributeName { CountryName , CommonName , LocalityName , Surname , GivenName , SerialNumber , Title , Initials , OrganizationName , OrganizationalUnitName , StateOrProvinceName , Pseudonym , DnAttributeNameCount } |
Distinguished name's attribute name. More... | |
Public Member Functions | |
const std::vector< DnAttribute > & | subjectDn () const |
Returns the distinguished name attributes of the subject. | |
std::string | subjectDnString () const |
Returns the distinguished name of the subject in string format. | |
const std::vector< DnAttribute > & | issuerDn () const |
Returns the distinguished name attributes of the issuer. | |
std::string | issuerDnString () const |
Returns the distinguished name of the issuer in string format. | |
const Wt::WDateTime & | validityStart () const |
Returns the start time of the validity period of the certificate. | |
const Wt::WDateTime & | validityEnd () const |
Returns the end time of the validity period of the certificate. | |
const std::string & | toPem () const |
Returns the textual PEM-encoded certificate. | |
std::string | toDer () const |
Returns the binary DER-encoded certificate. | |
Static Public Member Functions | |
static std::string | pemToDer (const std::string &pem) |
Convert a certificate from PEM encoding (textual) to DER encoding (binary). | |
An interface to an SSL certificate.
This class provides an interface to an X.509 certificate, as used by SSL (server and client cert). The certificates are usually obtained by calling methods of class WSslInfo.
This class offers you an interface to the raw (PEM/DER) certificate, as well as a convenient interface to the most common attribute fields. The attributes interpreted by Wt are limited to those listed in enum DnAttributeName.
The raw certificate can be queried in PEM/DER format, and a function is provided to convert PEM (textual format) to DER (binary format).
This class is only available when Wt was compiled with SSL support.
Distinguished name's attribute name.
Note: The values of this enum have no relation with the numerical ID used in the X.509 certificate.
const std::vector< DnAttribute > & Wt::WSslCertificate::issuerDn | ( | ) | const |
Returns the distinguished name attributes of the issuer.
The distinguished name (DN) of the authority that signed and therefore issued the certificate. This is the Certification Authority (CA), unless a certificate chain is used.
std::string Wt::WSslCertificate::issuerDnString | ( | ) | const |
Returns the distinguished name of the issuer in string format.
An example: CN=Pietje Puk,OU=Development,O=Emweb
|
static |
Convert a certificate from PEM encoding (textual) to DER encoding (binary).
This function throws an WException when the input string is not in the expected format.
const std::vector< DnAttribute > & Wt::WSslCertificate::subjectDn | ( | ) | const |
Returns the distinguished name attributes of the subject.
A distinguished name (DN) defining the entity associated with this certificate. Only the fields listed in enum DnAttributeName are decoded from the certificate.
std::string Wt::WSslCertificate::subjectDnString | ( | ) | const |
Returns the distinguished name of the subject in string format.
For example: CN=Pietje Puk,OU=Development,O=Emweb
std::string Wt::WSslCertificate::toDer | ( | ) | const |
Returns the binary DER-encoded certificate.
This function returns WSslCertificate::pemToDer(toPem()). It will therefore throw a WException if the conversion fails.
const std::string & Wt::WSslCertificate::toPem | ( | ) | const |
Returns the textual PEM-encoded certificate.
const Wt::WDateTime & Wt::WSslCertificate::validityEnd | ( | ) | const |
Returns the end time of the validity period of the certificate.
The returned date may be invalid if not provided in the certificate.
const Wt::WDateTime & Wt::WSslCertificate::validityStart | ( | ) | const |
Returns the start time of the validity period of the certificate.
The returned date may be invalid if not provided in the certificate.