OxideQSslCertificate Class

X.509 certificate More...

Header: #include <oxideqsslcertificate.h>
Instantiated By: SslCertificate

Public Types

enum PrincipalAttr { PrincipalAttrOrganizationName, PrincipalAttrCommonName, PrincipalAttrLocalityName, PrincipalAttrOrganizationUnitName, PrincipalAttrCountryName, PrincipalAttrStateOrProvinceName }

Public Functions

OxideQSslCertificate(const OxideQSslCertificate &other)
~OxideQSslCertificate()
QDateTime effectiveDate() const
QDateTime expiryDate() const
QString fingerprintSHA1() const
QStringList getIssuerInfo(PrincipalAttr attr) const
QStringList getSubjectInfo(PrincipalAttr attr) const
bool isExpired() const
bool isValid() const
QVariant issuer() const
QString issuerDisplayName() const
QString serialNumber() const
QString subjectDisplayName() const
QString toPem() const
bool operator!=(const OxideQSslCertificate &other) const
OxideQSslCertificate operator=(const OxideQSslCertificate &other)
bool operator==(const OxideQSslCertificate &other) const

Detailed Description

X.509 certificate

OxideQSslCertificate represents a X.509 certificate provided by a remote server.

Information about the subject of the certificate can be discovered by calling getSubjectInfo. Information about the issuer of the certificate (the entity that signed it) can be discovered by calling getIssuerInfo. For self-signed certificates, this will return the same as getSubjectInfo.

For certificates that aren't self-signed, the issuer's certificate can be accessed via issuer.

Member Type Documentation

enum OxideQSslCertificate::PrincipalAttr

This represents an issuer or subject field, which you can pass to getSubjectInfo or getIssuerInfo

ConstantValueDescription
OxideQSslCertificate::PrincipalAttrOrganizationName0'O' - The name of the organization.
OxideQSslCertificate::PrincipalAttrCommonName1'CN' - The Common Name. Generally used to store the host name.
OxideQSslCertificate::PrincipalAttrLocalityName2'L' - The locality.
OxideQSslCertificate::PrincipalAttrOrganizationUnitName3'OU' - The organizational unit name.
OxideQSslCertificate::PrincipalAttrCountryName4'C' - The country name.
OxideQSslCertificate::PrincipalAttrStateOrProvinceName5'ST' - The state or province name.

Member Function Documentation

OxideQSslCertificate::OxideQSslCertificate(const OxideQSslCertificate &other)

Copy constructs a certificate from other.

OxideQSslCertificate::~OxideQSslCertificate()

Destroys this certificate.

QDateTime OxideQSslCertificate::effectiveDate() const

Returns the start date for this certificate.

QDateTime OxideQSslCertificate::expiryDate() const

Returns the expiry date for this certificate.

QString OxideQSslCertificate::fingerprintSHA1() const

Returns the SHA1 fingerprint of this certificate as a hex encoded string.

QStringList OxideQSslCertificate::getIssuerInfo(PrincipalAttr attr) const

Returns the value of the field specified by attr for this certificate's issuer.

QStringList OxideQSslCertificate::getSubjectInfo(PrincipalAttr attr) const

Returns the value of the field specified by attr for this certificate's subject.

bool OxideQSslCertificate::isExpired() const

Returns true if this certificate has expired.

bool OxideQSslCertificate::isValid() const

Returns true if this is a valid certificate instance. Instances created with the default constructor are invalid.

QVariant OxideQSslCertificate::issuer() const

Returns the issuer of this certificate. If the certificate is not self-signed, this will be a valid OxideQSslCertificate. If the certificate is self-signed, this will be a null variant.

See also QVariant::isNull.

QString OxideQSslCertificate::issuerDisplayName() const

Returns the display name of the issuer of this certificate.

QString OxideQSslCertificate::serialNumber() const

Returns the serial number of this certificate as a hex encoded string.

See also QByteArray::toHex.

QString OxideQSslCertificate::subjectDisplayName() const

Returns the display name of the subject of this certificate.

QString OxideQSslCertificate::toPem() const

Returns a PEM encoded version of this certificate.

bool OxideQSslCertificate::operator!=(const OxideQSslCertificate &other) const

Returns true if this certificate does not equal other.

OxideQSslCertificate OxideQSslCertificate::operator=(const OxideQSslCertificate &other)

Assigns other to this certificate.

bool OxideQSslCertificate::operator==(const OxideQSslCertificate &other) const

Returns true if this certificate equals other. A certificate will only be equal to one that it was copied from.