Botan  2.17.3
Crypto and TLS for C++11
pkix_enums.h
Go to the documentation of this file.
1 /*
2 * (C) 2013 Jack Lloyd
3 *
4 * Botan is released under the Simplified BSD License (see license.txt)
5 */
6 
7 #ifndef BOTAN_X509_PKIX_ENUMS_H_
8 #define BOTAN_X509_PKIX_ENUMS_H_
9 
10 #include <botan/types.h>
11 
12 namespace Botan {
13 
14 /**
15 * Certificate validation status code
16 */
18  OK = 0,
19  VERIFIED = 0,
20 
21  // Revocation status
25  OCSP_NO_HTTP = 4,
26 
27  // Warnings
30  DN_TOO_LONG = 501,
33 
34  // Typo versions of above - will be removed in future major release
37 
38  // Errors
39  FIRST_ERROR_STATUS = 1000,
40 
42  UNTRUSTED_HASH = 1001,
43  NO_REVOCATION_DATA = 1002,
44  NO_MATCHING_CRLDP = 1003,
45 
46  // Time problems
47  CERT_NOT_YET_VALID = 2000,
48  CERT_HAS_EXPIRED = 2001,
49  OCSP_NOT_YET_VALID = 2002,
50  OCSP_HAS_EXPIRED = 2003,
51  CRL_NOT_YET_VALID = 2004,
52  CRL_HAS_EXPIRED = 2005,
53  OCSP_IS_TOO_OLD = 2006,
54 
55  // Chain generation problems
56  CERT_ISSUER_NOT_FOUND = 3000,
58  CERT_CHAIN_LOOP = 3002,
60  CHAIN_NAME_MISMATCH = 3004,
61 
62  // Validation errors
63  POLICY_ERROR = 4000,
64  INVALID_USAGE = 4001,
65  CERT_CHAIN_TOO_LONG = 4002,
67  NAME_CONSTRAINT_ERROR = 4004,
68 
69  // Revocation errors
71  OCSP_CERT_NOT_LISTED = 4006,
72  OCSP_BAD_STATUS = 4007,
73 
74  // Other problems
75  CERT_NAME_NOMATCH = 4008,
78  OCSP_SIGNATURE_ERROR = 4501,
79  OCSP_ISSUER_NOT_FOUND = 4502,
81  OCSP_RESPONSE_INVALID = 4504,
82  EXT_IN_V1_V2_CERT = 4505,
83  DUPLICATE_CERT_POLICY = 4506,
85 
86  // Hard failures
87  CERT_IS_REVOKED = 5000,
88  CRL_BAD_SIGNATURE = 5001,
89  SIGNATURE_ERROR = 5002,
90  CERT_PUBKEY_INVALID = 5003,
93 };
94 
95 /**
96 * Convert a status code to a human readable diagnostic message
97 * @param code the certifcate status
98 * @return string literal constant, or nullptr if code unknown
99 */
100 BOTAN_PUBLIC_API(2,0) const char* to_string(Certificate_Status_Code code);
101 
102 /**
103 * X.509v3 Key Constraints.
104 * If updating update copy in ffi.h
105 */
108  DIGITAL_SIGNATURE = 1 << 15,
109  NON_REPUDIATION = 1 << 14,
110  KEY_ENCIPHERMENT = 1 << 13,
111  DATA_ENCIPHERMENT = 1 << 12,
112  KEY_AGREEMENT = 1 << 11,
113  KEY_CERT_SIGN = 1 << 10,
114  CRL_SIGN = 1 << 9,
115  ENCIPHER_ONLY = 1 << 8,
116  DECIPHER_ONLY = 1 << 7
117 };
118 
119 /**
120 * X.509v2 CRL Reason Code.
121 * This will become an enum class in a future major release
122 */
123 enum CRL_Code : uint32_t {
135 
137  OCSP_GOOD = 0xFF01,
138  OCSP_UNKNOWN = 0xFF02
139 };
140 
141 }
142 
143 #endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
std::string to_string(ErrorType type)
Convert an ErrorType to string.
Definition: exceptn.cpp:11
Definition: alg_id.cpp:13
Certificate_Status_Code
Definition: pkix_enums.h:17
Key_Constraints
Definition: pkix_enums.h:106