Library: NetSSL_OpenSSL
Package: SSLCore
Header: Poco/Net/X509Certificate.h
This class extends Poco::Crypto::X509Certificate with the feature to validate a certificate.
Direct Base Classes: Poco::Crypto::X509Certificate
All Base Classes: Poco::Crypto::X509Certificate
Member Functions: containsWildcards, matchByAlias, operator =, verify
Inherited Functions: certificate, commonName, expiresOn, extractNames, init, issuedBy, issuerName, load, operator =, save, subjectName, swap, validFrom
explicit X509Certificate(
std::istream & istr
);
Creates the X509Certificate object by reading a certificate in PEM format from a stream.
explicit X509Certificate(
const std::string & path
);
Creates the X509Certificate object by reading a certificate in PEM format from a file.
explicit X509Certificate(
X509 * pCert
);
Creates the X509Certificate from an existing OpenSSL certificate. Ownership is taken of the certificate.
X509Certificate(
const Poco::Crypto::X509Certificate & cert
);
Creates the certificate by copying another one.
X509Certificate(
X509 * pCert,
bool shared
);
Creates the X509Certificate from an existing OpenSSL certificate. Ownership is taken of the certificate. If shared is true, the certificate's reference count is incremented.
~X509Certificate();
Destroys the X509Certificate.
X509Certificate & operator = (
const Poco::Crypto::X509Certificate & cert
);
Assigns a certificate.
bool verify(
const std::string & hostName
) const;
Verifies the validity of the certificate against the host name.
For this check to be successful, the certificate must contain a domain name that matches the domain name of the host.
Returns true if verification succeeded, or false otherwise.
static bool verify(
const Poco::Crypto::X509Certificate & cert,
const std::string & hostName
);
Verifies the validity of the certificate against the host name.
For this check to be successful, the certificate must contain a domain name that matches the domain name of the host.
Returns true if verification succeeded, or false otherwise.
static bool containsWildcards(
const std::string & commonName
);
static bool matchByAlias(
const std::string & alias,
const HostEntry & heData
);