This class represents a X509 Certificate.
More...
#include <X509Certificate.h>
|
static List | readPEM (const std::string &pemFileName) |
| Prints the certificate information to ostream.
|
|
static void | writePEM (const std::string &pemFileName, const List &list) |
|
|
void | load (std::istream &stream) |
| Writes the list of certificates to the specified PEM file.
|
|
void | load (const std::string &path) |
|
void | init () |
|
This class represents a X509 Certificate.
Definition at line 36 of file X509Certificate.h.
◆ List
◆ anonymous enum
Extracts issuer and subject name from the certificate.
Enumerator |
---|
NAME_BUFFER_SIZE | |
Definition at line 197 of file X509Certificate.h.
◆ NID
Name identifier for extracting information from a certificate subject's or issuer's distinguished name.
Enumerator |
---|
NID_COMMON_NAME | |
NID_COUNTRY | |
NID_LOCALITY_NAME | |
NID_STATE_OR_PROVINCE | |
NID_ORGANIZATION_NAME | |
NID_ORGANIZATION_UNIT_NAME | |
NID_PKCS9_EMAIL_ADDRESS | |
NID_SERIAL_NUMBER | |
Definition at line 42 of file X509Certificate.h.
◆ X509Certificate() [1/6]
Poco::Crypto::X509Certificate::X509Certificate |
( |
std::istream & | istr | ) |
|
|
explicit |
◆ X509Certificate() [2/6]
Poco::Crypto::X509Certificate::X509Certificate |
( |
const std::string & | path | ) |
|
|
explicit |
Creates the X509Certificate object by reading a certificate in PEM format from a stream.
◆ X509Certificate() [3/6]
Poco::Crypto::X509Certificate::X509Certificate |
( |
X509 * | pCert | ) |
|
|
explicit |
Creates the X509Certificate object by reading a certificate in PEM format from a file.
◆ X509Certificate() [4/6]
Poco::Crypto::X509Certificate::X509Certificate |
( |
X509 * | pCert, |
|
|
bool | shared ) |
Creates the X509Certificate from an existing OpenSSL certificate. Ownership is taken of the certificate.
◆ X509Certificate() [5/6]
Poco::Crypto::X509Certificate::X509Certificate |
( |
const X509Certificate & | cert | ) |
|
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() [6/6]
Creates the certificate by copying another one.
◆ ~X509Certificate()
Poco::Crypto::X509Certificate::~X509Certificate |
( |
| ) |
|
Exchanges the certificate with another one.
◆ certificate()
const X509 * Poco::Crypto::X509Certificate::certificate |
( |
| ) |
const |
|
inline |
Checks whether the certificate is equal to the other certificate, by comparing the hashes of both certificates.
Returns true if both certificates are identical, otherwise false.
Definition at line 242 of file X509Certificate.h.
◆ commonName()
std::string Poco::Crypto::X509Certificate::commonName |
( |
| ) |
const |
Extracts the information specified by the given NID (name identifier) from the certificate subject's distinguished name.
◆ dup()
X509 * Poco::Crypto::X509Certificate::dup |
( |
| ) |
const |
|
inline |
◆ equals()
bool Poco::Crypto::X509Certificate::equals |
( |
const X509Certificate & | otherCertificate | ) |
const |
Checks whether the certificate has been issued by the issuer given by issuerCertificate. This can be used to validate a certificate chain.
Verifies if the certificate has been signed with the issuer's private key, using the public key from the issuer certificate.
Returns true if verification against the issuer certificate was successful, false otherwise.
◆ expiresOn()
Returns the date and time the certificate is valid from.
◆ extractNames()
void Poco::Crypto::X509Certificate::extractNames |
( |
std::string & | commonName, |
|
|
std::set< std::string > & | domainNames ) const |
Returns the common name stored in the certificate subject's distinguished name.
◆ fingerprint()
Returns the date and time the certificate expires.
◆ init()
void Poco::Crypto::X509Certificate::init |
( |
| ) |
|
|
protected |
Loads the certificate from the given file. The certificate must be in PEM format.
◆ issuedBy()
bool Poco::Crypto::X509Certificate::issuedBy |
( |
const X509Certificate & | issuerCertificate | ) |
const |
Writes the certificate to the file given by path. The certificate is written in PEM format.
◆ issuerName() [1/2]
const std::string & Poco::Crypto::X509Certificate::issuerName |
( |
| ) |
const |
|
inline |
Returns the certificate serial number as a string in decimal encoding.
Definition at line 230 of file X509Certificate.h.
◆ issuerName() [2/2]
std::string Poco::Crypto::X509Certificate::issuerName |
( |
NID | nid | ) |
const |
Returns the certificate issuer's distinguished name.
◆ load() [1/2]
void Poco::Crypto::X509Certificate::load |
( |
const std::string & | path | ) |
|
|
protected |
Loads the certificate from the given stream. The certificate must be in PEM format.
◆ load() [2/2]
void Poco::Crypto::X509Certificate::load |
( |
std::istream & | stream | ) |
|
|
protected |
Writes the list of certificates to the specified PEM file.
◆ operator=() [1/2]
Creates the certificate by moving another one.
◆ operator=() [2/2]
◆ print()
void Poco::Crypto::X509Certificate::print |
( |
std::ostream & | out | ) |
const |
Returns the certificate signature algorithm long name.
◆ readPEM()
static List Poco::Crypto::X509Certificate::readPEM |
( |
const std::string & | pemFileName | ) |
|
|
static |
Prints the certificate information to ostream.
◆ save() [1/2]
void Poco::Crypto::X509Certificate::save |
( |
const std::string & | path | ) |
const |
Writes the certificate to the given stream. The certificate is written in PEM format.
◆ save() [2/2]
void Poco::Crypto::X509Certificate::save |
( |
std::ostream & | stream | ) |
const |
Computes and returns the fingerprint of the certificate, using the given algorithm. The algorithm must be supported by OpenSSL, e.g., "SHA1" or "SHA256".
◆ serialNumber()
const std::string & Poco::Crypto::X509Certificate::serialNumber |
( |
| ) |
const |
|
inline |
◆ signatureAlgorithm()
std::string Poco::Crypto::X509Certificate::signatureAlgorithm |
( |
| ) |
const |
Duplicates and returns the underlying OpenSSL certificate. Note that the caller assumes responsibility for the lifecycle of the created certificate.
◆ subjectName() [1/2]
const std::string & Poco::Crypto::X509Certificate::subjectName |
( |
| ) |
const |
|
inline |
Extracts the information specified by the given NID (name identifier) from the certificate issuer's distinguished name.
Definition at line 236 of file X509Certificate.h.
◆ subjectName() [2/2]
std::string Poco::Crypto::X509Certificate::subjectName |
( |
NID | nid | ) |
const |
Returns the certificate subject's distinguished name.
◆ swap()
◆ validFrom()
Extracts the common name and the alias domain names from the certificate.
◆ version()
long Poco::Crypto::X509Certificate::version |
( |
| ) |
const |
|
inline |
◆ writePEM()
static void Poco::Crypto::X509Certificate::writePEM |
( |
const std::string & | pemFileName, |
|
|
const List & | list ) |
|
static |
Reads and returns a list of certificates from the specified PEM file.
◆ _issuerName
std::string Poco::Crypto::X509Certificate::_issuerName |
|
private |
◆ _openSSLInitializer
◆ _pCert
X509* Poco::Crypto::X509Certificate::_pCert |
|
private |
◆ _serialNumber
std::string Poco::Crypto::X509Certificate::_serialNumber |
|
private |
◆ _subjectName
std::string Poco::Crypto::X509Certificate::_subjectName |
|
private |
The documentation for this class was generated from the following file:
- C:/Users/lachl/Downloads/ArkServerAPI_NEW/ASE/AseApi-main/include/Poco/Poco/Crypto/X509Certificate.h