CertificateStore Class Reference

#include <Pt/Ssl/CertificateStore.h>

A store for X509 certificates.

Classes

class  ConstIterator
 Iterator to a certificate in the store. More...
 

Public Member Functions

 CertificateStore ()
 Constructor.
 
 ~CertificateStore ()
 Destructor.
 
void loadPkcs12 (std::istream &is, const char *passwd)
 Loads PKCS12 data from a stream.
 
void loadPkcs12 (const char *data, std::size_t len, const char *passwd)
 Loads PKCS12 data from memory.
 
void loadPem (const char *data, std::size_t len, const char *passwd)
 Loads PEM data from memory.
 
const CertificatefindCertificate (const std::string &subject)
 Finds a certificate by subject. More...
 
const CertificategetCertificate (const std::string &subject)
 Gets a certificate by subject. More...
 
std::size_t size () const
 Returns the number of certificates in the store.
 
ConstIterator begin () const
 Returns an iterator to the begin of the certificates.
 
ConstIterator end () const
 Returns an iterator to the end of the certificates.
 

Member Function Documentation

◆ findCertificate()

const Certificate* findCertificate ( const std::string &  subject)

Searches for a certificate with the substring subject in it's subject. Returns nullptr if no certificate was found.

◆ getCertificate()

const Certificate& getCertificate ( const std::string &  subject)

Searches for a certificate with the substring subject in it's subject. Throws InvalidCertificate if no certificate with the subject was found.