• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 5111374265

29 May 2023 11:19AM UTC coverage: 92.227% (+0.5%) from 91.723%
5111374265

push

github

randombit
Next release will be 3.1.0. Update release notes

75588 of 81959 relevant lines covered (92.23%)

11886470.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/lib/x509/certstor_system/certstor_system.cpp
1
/*
2
* (C) 2019 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include <botan/certstor_system.h>
8

9
#include <botan/pkix_types.h>
10
#include <botan/x509cert.h>
11

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>
18
#endif
19

20
namespace Botan {
21

22
System_Certificate_Store::System_Certificate_Store() {
43✔
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)
28
   m_system_store = std::make_shared<Flatfile_Certificate_Store>(BOTAN_SYSTEM_CERT_BUNDLE, true);
43✔
29
#else
30
   throw Not_Implemented("No system certificate store available in this build");
31
#endif
32
}
43✔
33

34
std::optional<X509_Certificate> System_Certificate_Store::find_cert(const X509_DN& subject_dn,
5✔
35
                                                                    const std::vector<uint8_t>& key_id) const {
36
   return m_system_store->find_cert(subject_dn, key_id);
5✔
37
}
38

39
std::vector<X509_Certificate> System_Certificate_Store::find_all_certs(const X509_DN& subject_dn,
130✔
40
                                                                       const std::vector<uint8_t>& key_id) const {
41
   return m_system_store->find_all_certs(subject_dn, key_id);
130✔
42
}
43

44
std::optional<X509_Certificate> System_Certificate_Store::find_cert_by_pubkey_sha1(
4✔
45
   const std::vector<uint8_t>& key_hash) const {
46
   return m_system_store->find_cert_by_pubkey_sha1(key_hash);
4✔
47
}
48

49
std::optional<X509_Certificate> System_Certificate_Store::find_cert_by_raw_subject_dn_sha256(
×
50
   const std::vector<uint8_t>& subject_hash) const {
51
   return m_system_store->find_cert_by_raw_subject_dn_sha256(subject_hash);
×
52
}
53

54
std::optional<X509_CRL> System_Certificate_Store::find_crl_for(const X509_Certificate& subject) const {
6✔
55
   return m_system_store->find_crl_for(subject);
6✔
56
}
57

58
std::vector<X509_DN> System_Certificate_Store::all_subjects() const { return m_system_store->all_subjects(); }
3✔
59

60
}  // namespace Botan
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc