Botan 2.13.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::CERT_SERIAL_NEGATIVE:
26 return "Certificate serial number is negative";
27 case Certificate_Status_Code::DN_TOO_LONG:
28 return "Distinguished name too long";
29 case Certificate_Status_Code::OCSP_NO_REVOCATION_URL:
30 return "OCSP URL not available";
31 case Certificate_Status_Code::OCSP_SERVER_NOT_AVAILABLE:
32 return "OCSP server not available";
33
34 case Certificate_Status_Code::NO_REVOCATION_DATA:
35 return "No revocation data";
36 case Certificate_Status_Code::SIGNATURE_METHOD_TOO_WEAK:
37 return "Signature method too weak";
38 case Certificate_Status_Code::UNTRUSTED_HASH:
39 return "Hash function used is considered too weak for security";
40
41 case Certificate_Status_Code::CERT_NOT_YET_VALID:
42 return "Certificate is not yet valid";
43 case Certificate_Status_Code::CERT_HAS_EXPIRED:
44 return "Certificate has expired";
45 case Certificate_Status_Code::OCSP_NOT_YET_VALID:
46 return "OCSP is not yet valid";
47 case Certificate_Status_Code::OCSP_HAS_EXPIRED:
48 return "OCSP response has expired";
49 case Certificate_Status_Code::OCSP_IS_TOO_OLD:
50 return "OCSP response is too old";
51 case Certificate_Status_Code::CRL_NOT_YET_VALID:
52 return "CRL response is not yet valid";
53 case Certificate_Status_Code::CRL_HAS_EXPIRED:
54 return "CRL has expired";
55
56 case Certificate_Status_Code::CERT_ISSUER_NOT_FOUND:
57 return "Certificate issuer not found";
58 case Certificate_Status_Code::CANNOT_ESTABLISH_TRUST:
59 return "Cannot establish trust";
60 case Certificate_Status_Code::CERT_CHAIN_LOOP:
61 return "Loop in certificate chain";
62 case Certificate_Status_Code::CHAIN_LACKS_TRUST_ROOT:
63 return "Certificate chain does not end in a CA certificate";
64 case Certificate_Status_Code::CHAIN_NAME_MISMATCH:
65 return "Certificate issuer does not match subject of issuing cert";
66
67 case Certificate_Status_Code::POLICY_ERROR:
68 return "Certificate policy error";
69 case Certificate_Status_Code::DUPLICATE_CERT_POLICY:
70 return "Certificate contains duplicate policy";
71 case Certificate_Status_Code::INVALID_USAGE:
72 return "Certificate does not allow the requested usage";
73 case Certificate_Status_Code::CERT_CHAIN_TOO_LONG:
74 return "Certificate chain too long";
75 case Certificate_Status_Code::CA_CERT_NOT_FOR_CERT_ISSUER:
76 return "CA certificate not allowed to issue certs";
77 case Certificate_Status_Code::CA_CERT_NOT_FOR_CRL_ISSUER:
78 return "CA certificate not allowed to issue CRLs";
79 case Certificate_Status_Code::NO_MATCHING_CRLDP:
80 return "No CRL with matching distribution point for certificate";
81 case Certificate_Status_Code::OCSP_CERT_NOT_LISTED:
82 return "OCSP cert not listed";
83 case Certificate_Status_Code::OCSP_BAD_STATUS:
84 return "OCSP bad status";
85 case Certificate_Status_Code::CERT_NAME_NOMATCH:
86 return "Certificate does not match provided name";
87 case Certificate_Status_Code::NAME_CONSTRAINT_ERROR:
88 return "Certificate does not pass name constraint";
89 case Certificate_Status_Code::UNKNOWN_CRITICAL_EXTENSION:
90 return "Unknown critical extension encountered";
91 case Certificate_Status_Code::DUPLICATE_CERT_EXTENSION:
92 return "Duplicate certificate extension encountered";
93 case Certificate_Status_Code::EXT_IN_V1_V2_CERT:
94 return "Encountered extension in certificate with version < 3";
95 case Certificate_Status_Code::OCSP_SIGNATURE_ERROR:
96 return "OCSP signature error";
97 case Certificate_Status_Code::OCSP_ISSUER_NOT_FOUND:
98 return "Unable to find certificate issusing OCSP response";
99 case Certificate_Status_Code::OCSP_RESPONSE_MISSING_KEYUSAGE:
100 return "OCSP issuer's keyusage prohibits OCSP";
101 case Certificate_Status_Code::OCSP_RESPONSE_INVALID:
102 return "OCSP parsing valid";
103 case Certificate_Status_Code::OCSP_NO_HTTP:
104 return "OCSP requests not available, no HTTP support compiled in";
105 case Certificate_Status_Code::CERT_IS_REVOKED:
106 return "Certificate is revoked";
107 case Certificate_Status_Code::CRL_BAD_SIGNATURE:
108 return "CRL bad signature";
109 case Certificate_Status_Code::SIGNATURE_ERROR:
110 return "Signature error";
111 case Certificate_Status_Code::CERT_PUBKEY_INVALID:
112 return "Certificate public key invalid";
113 case Certificate_Status_Code::SIGNATURE_ALGO_UNKNOWN:
114 return "Certificate signed with unknown/unavailable algorithm";
115 case Certificate_Status_Code::SIGNATURE_ALGO_BAD_PARAMS:
116 return "Certificate signature has invalid parameters";
117
118 // intentionally no default so we are warned if new enum values are added
119 }
120
121 return nullptr;
122 }
123
124 }
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::CERT_SERIAL_NEGATIVE
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::OCSP_SERVER_NOT_AVAILABLE
Botan::Certificate_Status_Code::DUPLICATE_CERT_EXTENSION
Botan::Certificate_Status_Code::OCSP_IS_TOO_OLD
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::to_string
std::string to_string(ErrorType type)
Convert an ErrorType to string.
Definition: exceptn.cpp:11
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::Certificate_Status_Code::SIGNATURE_ALGO_BAD_PARAMS
Botan::Certificate_Status_Code::CERT_NOT_YET_VALID
Botan::Certificate_Status_Code::DUPLICATE_CERT_POLICY
Botan::Certificate_Status_Code::OCSP_HAS_EXPIRED
Botan::Certificate_Status_Code::SIGNATURE_ALGO_UNKNOWN
Botan::Certificate_Status_Code::OCSP_SIGNATURE_OK
Botan::Certificate_Status_Code::OCSP_NO_REVOCATION_URL
Botan::Certificate_Status_Code
Certificate_Status_Code
Definition: cert_status.h:19
Botan::Certificate_Status_Code::EXT_IN_V1_V2_CERT
Botan::Certificate_Status_Code::DN_TOO_LONG
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::NO_MATCHING_CRLDP
Botan::Certificate_Status_Code::CA_CERT_NOT_FOR_CERT_ISSUER