Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

cert_status.cpp
Go to the documentation of this file.
1 /*
2 * (C) 2016 Jack Lloyd
3 *
4 * Botan is released under the Simplified BSD License (see license.txt)
5 */
6
7 #include <botan/cert_status.h>
8
9 namespace Botan {
10
11 //static
12 const char* to_string(Certificate_Status_Code code)
13 {
14 switch(code)
15 {
16 case Certificate_Status_Code::VERIFIED:
17 return "Verified";
18 case Certificate_Status_Code::OCSP_RESPONSE_GOOD:
19 return "OCSP response accepted as affirming unrevoked status for certificate";
20 case Certificate_Status_Code::OCSP_SIGNATURE_OK:
21 return "Signature on OCSP response was found valid";
22 case Certificate_Status_Code::VALID_CRL_CHECKED:
23 return "Valid CRL examined";
24
25 case Certificate_Status_Code::NO_REVOCATION_DATA:
26 return "No revocation data";
27 case Certificate_Status_Code::SIGNATURE_METHOD_TOO_WEAK:
28 return "Signature method too weak";
29 case Certificate_Status_Code::UNTRUSTED_HASH:
30 return "Hash function used is considered too weak for security";
31
32 case Certificate_Status_Code::CERT_NOT_YET_VALID:
33 return "Certificate is not yet valid";
34 case Certificate_Status_Code::CERT_HAS_EXPIRED:
35 return "Certificate has expired";
36 case Certificate_Status_Code::OCSP_NOT_YET_VALID:
37 return "OCSP is not yet valid";
38 case Certificate_Status_Code::OCSP_HAS_EXPIRED:
39 return "OCSP response has expired";
40 case Certificate_Status_Code::CRL_NOT_YET_VALID:
41 return "CRL response is not yet valid";
42 case Certificate_Status_Code::CRL_HAS_EXPIRED:
43 return "CRL has expired";
44
45 case Certificate_Status_Code::CERT_ISSUER_NOT_FOUND:
46 return "Certificate issuer not found";
47 case Certificate_Status_Code::CANNOT_ESTABLISH_TRUST:
48 return "Cannot establish trust";
49 case Certificate_Status_Code::CERT_CHAIN_LOOP:
50 return "Loop in certificate chain";
51 case Certificate_Status_Code::CHAIN_LACKS_TRUST_ROOT:
52 return "Certificate chain does not end in a CA certificate";
53 case Certificate_Status_Code::CHAIN_NAME_MISMATCH:
54 return "Certificate issuer does not match subject of issuing cert";
55
56 case Certificate_Status_Code::POLICY_ERROR:
57 return "Certificate policy error";
58 case Certificate_Status_Code::INVALID_USAGE:
59 return "Certificate does not allow the requested usage";
60 case Certificate_Status_Code::CERT_CHAIN_TOO_LONG:
61 return "Certificate chain too long";
62 case Certificate_Status_Code::CA_CERT_NOT_FOR_CERT_ISSUER:
63 return "CA certificate not allowed to issue certs";
64 case Certificate_Status_Code::CA_CERT_NOT_FOR_CRL_ISSUER:
65 return "CA certificate not allowed to issue CRLs";
66 case Certificate_Status_Code::OCSP_CERT_NOT_LISTED:
67 return "OCSP cert not listed";
68 case Certificate_Status_Code::OCSP_BAD_STATUS:
69 return "OCSP bad status";
70 case Certificate_Status_Code::CERT_NAME_NOMATCH:
71 return "Certificate does not match provided name";
72 case Certificate_Status_Code::NAME_CONSTRAINT_ERROR:
73 return "Certificate does not pass name constraint";
74 case Certificate_Status_Code::UNKNOWN_CRITICAL_EXTENSION:
75 return "Unknown critical extension encountered";
76 case Certificate_Status_Code::OCSP_SIGNATURE_ERROR:
77 return "OCSP signature error";
78 case Certificate_Status_Code::OCSP_ISSUER_NOT_FOUND:
79 return "Unable to find certificate issusing OCSP response";
80 case Certificate_Status_Code::OCSP_RESPONSE_MISSING_KEYUSAGE:
81 return "OCSP issuer's keyusage prohibits OCSP";
82 case Certificate_Status_Code::OCSP_RESPONSE_INVALID:
83 return "OCSP parsing valid";
84 case Certificate_Status_Code::OCSP_NO_HTTP:
85 return "OCSP requests not available, no HTTP support compiled in";
86 case Certificate_Status_Code::CERT_IS_REVOKED:
87 return "Certificate is revoked";
88 case Certificate_Status_Code::CRL_BAD_SIGNATURE:
89 return "CRL bad signature";
90 case Certificate_Status_Code::SIGNATURE_ERROR:
91 return "Signature error";
92 case Certificate_Status_Code::CERT_PUBKEY_INVALID:
93 return "Certificate public key invalid";
94 // intentionally no default so we are warned
95 }
96
97 return nullptr;
98 }
99
100 }
Botan::Certificate_Status_Code::NAME_CONSTRAINT_ERROR
Botan::Certificate_Status_Code::CERT_NAME_NOMATCH
Botan::Certificate_Status_Code::OCSP_SIGNATURE_ERROR
Botan::Certificate_Status_Code::OCSP_RESPONSE_MISSING_KEYUSAGE
Botan::Certificate_Status_Code::OCSP_CERT_NOT_LISTED
Botan::Certificate_Status_Code::POLICY_ERROR
Botan::Certificate_Status_Code::UNKNOWN_CRITICAL_EXTENSION
Botan::Certificate_Status_Code::CANNOT_ESTABLISH_TRUST
Botan::Certificate_Status_Code::CERT_PUBKEY_INVALID
Botan::Certificate_Status_Code::SIGNATURE_ERROR
Botan::Certificate_Status_Code::VALID_CRL_CHECKED
Botan::Certificate_Status_Code::CRL_BAD_SIGNATURE
Botan::Certificate_Status_Code::CRL_NOT_YET_VALID
Botan::Certificate_Status_Code::OCSP_RESPONSE_GOOD
Botan::Certificate_Status_Code::CA_CERT_NOT_FOR_CRL_ISSUER
Botan::Certificate_Status_Code::CHAIN_LACKS_TRUST_ROOT
Botan::Certificate_Status_Code::CHAIN_NAME_MISMATCH
Botan::Certificate_Status_Code::OCSP_BAD_STATUS
Botan::Certificate_Status_Code::CERT_CHAIN_TOO_LONG
Botan::Certificate_Status_Code::OCSP_NOT_YET_VALID
Botan::Certificate_Status_Code::CERT_HAS_EXPIRED
Botan::Certificate_Status_Code::SIGNATURE_METHOD_TOO_WEAK
Botan::Certificate_Status_Code::UNTRUSTED_HASH
Botan::Certificate_Status_Code::CERT_ISSUER_NOT_FOUND
Botan::Certificate_Status_Code::CERT_CHAIN_LOOP
Botan
Definition: alg_id.cpp:13
Botan::Certificate_Status_Code::CRL_HAS_EXPIRED
Botan::to_string
std::string to_string(const secure_vector< uint8_t > &bytes)
Definition: stl_util.h:25
Botan::Certificate_Status_Code::CERT_NOT_YET_VALID
Botan::Certificate_Status_Code::OCSP_HAS_EXPIRED
Botan::Certificate_Status_Code::OCSP_SIGNATURE_OK
Botan::Certificate_Status_Code
Certificate_Status_Code
Definition: cert_status.h:18
Botan::Certificate_Status_Code::OCSP_RESPONSE_INVALID
Botan::Certificate_Status_Code::VERIFIED
Botan::Certificate_Status_Code::OCSP_ISSUER_NOT_FOUND
Botan::Certificate_Status_Code::CERT_IS_REVOKED
Botan::Certificate_Status_Code::OCSP_NO_HTTP
Botan::Certificate_Status_Code::NO_REVOCATION_DATA
Botan::Certificate_Status_Code::INVALID_USAGE
Botan::Certificate_Status_Code::CA_CERT_NOT_FOR_CERT_ISSUER