|
My Project 3.6.0
C++ Distributed Hash Table
|

Public Member Functions | |
| Certificate (gnutls_x509_crt_t crt) noexcept | |
| Certificate (Certificate &&o) noexcept | |
| Certificate (const Blob &crt) | |
| Certificate (const uint8_t *dat, size_t dat_size) | |
| Certificate (std::string_view pem) | |
| template<typename Iterator> | |
| Certificate (const Iterator &begin, const Iterator &end) | |
| template<typename Iterator> | |
| Certificate (const std::vector< std::pair< Iterator, Iterator > > &certs) | |
| Certificate & | operator= (Certificate &&o) noexcept |
| void | pack (Blob &b) const |
| void | unpack (const uint8_t *dat, size_t dat_size) |
| Blob | getPacked () const |
| template<typename Iterator> | |
| void | unpack (const Iterator &begin, const Iterator &end) |
| template<typename Iterator> | |
| void | unpack (const std::vector< std::pair< Iterator, Iterator > > &certs) |
| template<typename Packer> | |
| void | msgpack_pack (Packer &p) const |
| void | msgpack_unpack (const msgpack::object &o) |
| operator bool () const | |
| const PublicKey & | getPublicKey () const |
| const std::shared_ptr< PublicKey > & | getSharedPublicKey () const |
| const InfoHash & | getId () const |
| const PkId & | getLongId () const |
| Blob | getSerialNumber () const |
| std::string | getDN () const |
| std::string | getName () const |
| std::string | getUID () const |
| std::string | getIssuerDN () const |
| std::string | getIssuerName () const |
| std::string | getIssuerUID () const |
| std::vector< std::pair< NameType, std::string > > | getAltNames () const |
| std::chrono::system_clock::time_point | getActivation () const |
| std::chrono::system_clock::time_point | getExpiration () const |
| bool | isCA () const |
| std::string | toString (bool chain=true) const |
| std::string | print () const |
| void | revoke (const PrivateKey &, const Certificate &) |
| std::vector< std::shared_ptr< RevocationList > > | getRevocationLists () const |
| void | addRevocationList (RevocationList &&) |
| void | addRevocationList (std::shared_ptr< RevocationList >) |
| gnutls_x509_crt_t | getCopy () const |
| std::vector< gnutls_x509_crt_t > | getChain (bool copy=false) const |
| std::pair< std::vector< gnutls_x509_crt_t >, std::vector< gnutls_x509_crl_t > > | getChainWithRevocations (bool copy=false) const |
| gnutls_digest_algorithm_t | getPreferredDigest () const |
| std::pair< std::string, Blob > | generateOcspRequest (gnutls_x509_crt_t &issuer) |
| void | setValidity (const Identity &ca, int64_t validity) |
| void | setValidity (const PrivateKey &key, int64_t validity) |
Static Public Member Functions | |
| static Certificate | generate (const PrivateKey &key, const std::string &name="dhtnode", const Identity &ca={}, bool is_ca=false, int64_t validity=0) |
| static Certificate | generate (const CertificateRequest &request, const Identity &ca, int64_t validity=0) |
Public Attributes | |
| gnutls_x509_crt_t | cert {nullptr} |
| std::shared_ptr< Certificate > | issuer {} |
| std::shared_ptr< OcspResponse > | ocspResponse |
|
inlinenoexcept |
|
inlinenoexcept |
| dht::crypto::Certificate::Certificate | ( | const Blob & | crt | ) |
Import certificate (PEM or DER) or certificate chain (PEM), ordered from subject to issuer
|
inline |
|
inline |
|
inline |
|
inline |
| void dht::crypto::Certificate::addRevocationList | ( | RevocationList && | ) |
Attach existing revocation list.
| std::vector< std::pair< NameType, std::string > > dht::crypto::Certificate::getAltNames | ( | ) | const |
Read certificate alternative names
|
inline |
|
inline |
|
inline |
| std::string dht::crypto::Certificate::getDN | ( | ) | const |
Read certificate full DN as described in RFC4514
| const InfoHash & dht::crypto::Certificate::getId | ( | ) | const |
Same as getPublicKey().getId()
| std::string dht::crypto::Certificate::getIssuerDN | ( | ) | const |
Read certificate issuer DN as described in RFC4514
| std::string dht::crypto::Certificate::getIssuerName | ( | ) | const |
Read certificate issuer Common Name (CN)
| std::string dht::crypto::Certificate::getIssuerUID | ( | ) | const |
Read certificate issuer User ID (UID)
| const PkId & dht::crypto::Certificate::getLongId | ( | ) | const |
Same as getPublicKey().getLongId()
| std::string dht::crypto::Certificate::getName | ( | ) | const |
Read certificate Common Name (CN)
| std::vector< std::shared_ptr< RevocationList > > dht::crypto::Certificate::getRevocationLists | ( | ) | const |
Get the list of certificates revoked as as CA.
| std::string dht::crypto::Certificate::getUID | ( | ) | const |
Read certificate User ID (UID)
| bool dht::crypto::Certificate::isCA | ( | ) | const |
Returns true if the certificate is marked as a Certificate Authority and has necessary key usage flags to sign certificates.
|
inline |
|
inlineexplicit |
| void dht::crypto::Certificate::revoke | ( | const PrivateKey & | , |
| const Certificate & | ) |
As a CA, revoke a certificate, adding it to the attached Certificate Revocation List (CRL)
| void dht::crypto::Certificate::setValidity | ( | const Identity & | ca, |
| int64_t | validity ) |
Change certificate's expiration
| std::string dht::crypto::Certificate::toString | ( | bool | chain = true | ) | const |
PEM encoded certificate. If chain is true, the issuer chain will be included (default).
|
inline |
|
inline |
Import certificate chain (PEM or DER). Certificates are not checked during import.
Iterator is the type of an iterator or pointer to the bytes of the certificates to import.
| certs | list of (begin, end) iterator pairs, pointing to the PEM or DER certificate data to import, that should be ordered from subject to issuer. |
| std::shared_ptr<Certificate> dht::crypto::Certificate::issuer {} |
| std::shared_ptr<OcspResponse> dht::crypto::Certificate::ocspResponse |