7#include <botan/certstor_system.h>
9#include <botan/pkix_types.h>
10#include <botan/x509cert.h>
12#if defined(BOTAN_HAS_CERTSTOR_MACOS)
13 #include <botan/certstor_macos.h>
14#elif defined(BOTAN_HAS_CERTSTOR_WINDOWS)
15 #include <botan/certstor_windows.h>
16#elif defined(BOTAN_HAS_CERTSTOR_FLATFILE) && defined(BOTAN_SYSTEM_CERT_BUNDLE)
17 #include <botan/certstor_flatfile.h>
23#if defined(BOTAN_HAS_CERTSTOR_MACOS)
24 m_system_store = std::make_shared<Certificate_Store_MacOS>();
25#elif defined(BOTAN_HAS_CERTSTOR_WINDOWS)
26 m_system_store = std::make_shared<Certificate_Store_Windows>();
27#elif defined(BOTAN_HAS_CERTSTOR_FLATFILE) && defined(BOTAN_SYSTEM_CERT_BUNDLE)
30 throw Not_Implemented(
"No system certificate store available in this build");
35 const std::vector<uint8_t>& key_id)
const {
36 return m_system_store->find_cert(subject_dn, key_id);
40 const std::vector<uint8_t>& key_id)
const {
41 return m_system_store->find_all_certs(subject_dn, key_id);
45 const std::vector<uint8_t>& key_hash)
const {
46 return m_system_store->find_cert_by_pubkey_sha1(key_hash);
50 const std::vector<uint8_t>& subject_hash)
const {
51 return m_system_store->find_cert_by_raw_subject_dn_sha256(subject_hash);
55 return m_system_store->find_crl_for(subject);
59 return m_system_store->all_subjects();
std::vector< X509_DN > all_subjects() const override
std::optional< X509_Certificate > find_cert_by_raw_subject_dn_sha256(const std::vector< uint8_t > &subject_hash) const override
System_Certificate_Store()
std::vector< X509_Certificate > find_all_certs(const X509_DN &subject_dn, const std::vector< uint8_t > &key_id) const override
std::optional< X509_CRL > find_crl_for(const X509_Certificate &subject) const override
std::optional< X509_Certificate > find_cert_by_pubkey_sha1(const std::vector< uint8_t > &key_hash) const override
std::optional< X509_Certificate > find_cert(const X509_DN &subject_dn, const std::vector< uint8_t > &key_id) const override
#define BOTAN_SYSTEM_CERT_BUNDLE