8#ifndef BOTAN_CERT_STORE_SQL_H_
9#define BOTAN_CERT_STORE_SQL_H_
11#include <botan/certstor.h>
12#include <botan/database.h>
13#include <botan/x509_crl.h>
14#include <botan/x509cert.h>
34 std::string_view passwd,
36 std::string_view table_prefix =
"");
42 const std::vector<uint8_t>& key_id)
const override;
49 const std::vector<uint8_t>& key_id)
const override;
54 const std::vector<uint8_t>& subject_hash)
const override;
107 std::shared_ptr<SQL_Database> m_database;
108 std::string m_prefix;
109 std::string m_password;
#define BOTAN_PUBLIC_API(maj, min)
std::vector< X509_DN > all_subjects() const override
bool insert_cert(const X509_Certificate &cert)
std::vector< X509_Certificate > find_all_certs(const X509_DN &subject_dn, const std::vector< uint8_t > &key_id) const override
std::optional< X509_Certificate > find_cert_by_raw_subject_dn_sha256(const std::vector< uint8_t > &subject_hash) const override
std::optional< X509_CRL > find_crl_for(const X509_Certificate &issuer) const override
void revoke_cert(const X509_Certificate &cert, CRL_Code reason, const X509_Time &time=X509_Time())
Marks "cert" as revoked starting from "time".
Certificate_Store_In_SQL(std::shared_ptr< SQL_Database > db, std::string_view passwd, RandomNumberGenerator &rng, std::string_view table_prefix="")
std::vector< X509_Certificate > find_certs_for_key(const Private_Key &key) const
Returns all certificates for private key "key".
void affirm_cert(const X509_Certificate &cert)
Reverses the revocation for "cert".
bool remove_cert(const X509_Certificate &cert)
std::shared_ptr< const Private_Key > find_key(const X509_Certificate &cert) const
Returns the private key for "cert" or an empty shared_ptr if none was found.
std::optional< X509_Certificate > find_cert(const X509_DN &subject_dn, const std::vector< uint8_t > &key_id) const override
void remove_key(const Private_Key &key)
Removes "key" from the store.
bool insert_key(const X509_Certificate &cert, const Private_Key &key)
std::optional< X509_Certificate > find_cert_by_pubkey_sha1(const std::vector< uint8_t > &key_hash) const override
std::vector< X509_CRL > generate_crls() const