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.
 
ConstIterator begin () const
 Returns an iterator to the begin of the certificates.
 
ConstIterator end () const
 Returns an iterator to the end of the certificates.
 
const CertificatefindCertificate (const std::string &subject)
 Finds a certificate by subject. More...
 
const CertificategetCertificate (const std::string &subject)
 Gets a certificate by subject. More...
 
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.
 
std::size_t size () const
 Returns the number of certificates in the store.
 

Member Function Documentation

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.

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.