Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Net::X509Certificate Class Reference

#include <X509Certificate.h>

+ Inheritance diagram for Poco::Net::X509Certificate:
+ Collaboration diagram for Poco::Net::X509Certificate:

Public Member Functions

 X509Certificate (std::istream &istr)
 
 X509Certificate (const std::string &path)
 
 X509Certificate (X509 *pCert)
 
 X509Certificate (X509 *pCert, bool shared)
 
 X509Certificate (const Poco::Crypto::X509Certificate &cert)
 
 X509Certificate (const X509Certificate &cert)
 Creates the certificate by copying another one.
 
 X509Certificate (X509Certificate &&cert) noexcept
 Creates the certificate by copying another one.
 
X509Certificateoperator= (const Poco::Crypto::X509Certificate &cert)
 Creates the certificate by moving another one.
 
X509Certificateoperator= (const X509Certificate &cert)
 Assigns a certificate.
 
X509Certificateoperator= (X509Certificate &&cert) noexcept
 Assigns a certificate.
 
 ~X509Certificate ()
 Moves a certificate.
 
bool verify (const std::string &hostName) const
 Destroys the X509Certificate.
 
- Public Member Functions inherited from Poco::Crypto::X509Certificate
 X509Certificate (std::istream &istr)
 
 X509Certificate (const std::string &path)
 
 X509Certificate (X509 *pCert)
 
 X509Certificate (X509 *pCert, bool shared)
 
 X509Certificate (const X509Certificate &cert)
 
 X509Certificate (X509Certificate &&cert) noexcept
 Creates the certificate by copying another one.
 
X509Certificateoperator= (const X509Certificate &cert)
 Creates the certificate by moving another one.
 
X509Certificateoperator= (X509Certificate &&cert) noexcept
 Assigns a certificate.
 
void swap (X509Certificate &cert)
 Move assignment.
 
 ~X509Certificate ()
 Exchanges the certificate with another one.
 
long version () const
 Destroys the X509Certificate.
 
const std::string & serialNumber () const
 Returns the version of the certificate.
 
const std::string & issuerName () const
 
std::string issuerName (NID nid) const
 Returns the certificate issuer's distinguished name.
 
const std::string & subjectName () const
 
std::string subjectName (NID nid) const
 Returns the certificate subject's distinguished name.
 
std::string commonName () const
 
void extractNames (std::string &commonName, std::set< std::string > &domainNames) const
 
Poco::DateTime validFrom () const
 
Poco::DateTime expiresOn () const
 Returns the date and time the certificate is valid from.
 
Poco::DigestEngine::Digest fingerprint (const std::string &algorithm="SHA1") const
 Returns the date and time the certificate expires.
 
void save (std::ostream &stream) const
 
void save (const std::string &path) const
 
bool issuedBy (const X509Certificate &issuerCertificate) const
 
bool equals (const X509Certificate &otherCertificate) const
 
const X509certificate () const
 
X509dup () const
 Returns the underlying OpenSSL certificate.
 
std::string signatureAlgorithm () const
 
void print (std::ostream &out) const
 Returns the certificate signature algorithm long name.
 

Static Public Member Functions

static bool verify (const Poco::Crypto::X509Certificate &cert, const std::string &hostName)
 
- Static Public Member Functions inherited from Poco::Crypto::X509Certificate
static List readPEM (const std::string &pemFileName)
 Prints the certificate information to ostream.
 
static void writePEM (const std::string &pemFileName, const List &list)
 

Static Protected Member Functions

static bool containsWildcards (const std::string &commonName)
 
static bool matchWildcard (const std::string &alias, const std::string &hostName)
 

Private Types

enum  { NAME_BUFFER_SIZE = 256 }
 

Additional Inherited Members

- Public Types inherited from Poco::Crypto::X509Certificate
enum  NID {
  NID_COMMON_NAME = 13 , NID_COUNTRY = 14 , NID_LOCALITY_NAME = 15 , NID_STATE_OR_PROVINCE = 16 ,
  NID_ORGANIZATION_NAME = 17 , NID_ORGANIZATION_UNIT_NAME = 18 , NID_PKCS9_EMAIL_ADDRESS = 48 , NID_SERIAL_NUMBER = 105
}
 
using List = std::vector<X509Certificate>
 
- Protected Member Functions inherited from Poco::Crypto::X509Certificate
void load (std::istream &stream)
 Writes the list of certificates to the specified PEM file.
 
void load (const std::string &path)
 
void init ()
 

Detailed Description

This class extends Poco::Crypto::X509Certificate with the feature to validate a certificate.

Definition at line 36 of file X509Certificate.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
NAME_BUFFER_SIZE 

Definition at line 104 of file X509Certificate.h.

Constructor & Destructor Documentation

◆ X509Certificate() [1/7]

Poco::Net::X509Certificate::X509Certificate ( std::istream & istr)
explicit

◆ X509Certificate() [2/7]

Poco::Net::X509Certificate::X509Certificate ( const std::string & path)
explicit

Creates the X509Certificate object by reading a certificate in PEM format from a stream.

◆ X509Certificate() [3/7]

Poco::Net::X509Certificate::X509Certificate ( X509 * pCert)
explicit

Creates the X509Certificate object by reading a certificate in PEM format from a file.

◆ X509Certificate() [4/7]

Poco::Net::X509Certificate::X509Certificate ( X509 * pCert,
bool shared )

Creates the X509Certificate from an existing OpenSSL certificate. Ownership is taken of the certificate.

◆ X509Certificate() [5/7]

Poco::Net::X509Certificate::X509Certificate ( const Poco::Crypto::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/7]

Poco::Net::X509Certificate::X509Certificate ( const X509Certificate & cert)

Creates the certificate by copying another one.

◆ X509Certificate() [7/7]

Poco::Net::X509Certificate::X509Certificate ( X509Certificate && cert)
noexcept

Creates the certificate by copying another one.

◆ ~X509Certificate()

Poco::Net::X509Certificate::~X509Certificate ( )

Moves a certificate.

Member Function Documentation

◆ containsWildcards()

static bool Poco::Net::X509Certificate::containsWildcards ( const std::string & commonName)
staticprotected

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.

◆ matchWildcard()

static bool Poco::Net::X509Certificate::matchWildcard ( const std::string & alias,
const std::string & hostName )
staticprotected

◆ operator=() [1/3]

X509Certificate & Poco::Net::X509Certificate::operator= ( const Poco::Crypto::X509Certificate & cert)

Creates the certificate by moving another one.

◆ operator=() [2/3]

X509Certificate & Poco::Net::X509Certificate::operator= ( const X509Certificate & cert)

Assigns a certificate.

◆ operator=() [3/3]

X509Certificate & Poco::Net::X509Certificate::operator= ( X509Certificate && cert)
noexcept

Assigns a certificate.

◆ verify() [1/2]

static bool Poco::Net::X509Certificate::verify ( const Poco::Crypto::X509Certificate & cert,
const std::string & hostName )
static

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.

◆ verify() [2/2]

bool Poco::Net::X509Certificate::verify ( const std::string & hostName) const

Destroys the X509Certificate.


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