Botan  2.15.0
Crypto and TLS for C++11
cert_status.h
Go to the documentation of this file.
1 /*
2 * Path validation result enums
3 * (C) 2013 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_X509_PATH_RESULT_H_
9 #define BOTAN_X509_PATH_RESULT_H_
10 
11 #include <botan/types.h>
12 
13 namespace Botan {
14 
15 /**
16 * Certificate validation status code
17 */
19  OK = 0,
20  VERIFIED = 0,
21 
22  // Revocation status
26  OCSP_NO_HTTP = 4,
27 
28  // Warnings
31  DN_TOO_LONG = 501,
34 
35  // Typo versions of above - will be removed in future major release
38 
39  // Errors
40  FIRST_ERROR_STATUS = 1000,
41 
43  UNTRUSTED_HASH = 1001,
44  NO_REVOCATION_DATA = 1002,
45  NO_MATCHING_CRLDP = 1003,
46 
47  // Time problems
48  CERT_NOT_YET_VALID = 2000,
49  CERT_HAS_EXPIRED = 2001,
50  OCSP_NOT_YET_VALID = 2002,
51  OCSP_HAS_EXPIRED = 2003,
52  CRL_NOT_YET_VALID = 2004,
53  CRL_HAS_EXPIRED = 2005,
54  OCSP_IS_TOO_OLD = 2006,
55 
56  // Chain generation problems
57  CERT_ISSUER_NOT_FOUND = 3000,
59  CERT_CHAIN_LOOP = 3002,
61  CHAIN_NAME_MISMATCH = 3004,
62 
63  // Validation errors
64  POLICY_ERROR = 4000,
65  INVALID_USAGE = 4001,
66  CERT_CHAIN_TOO_LONG = 4002,
68  NAME_CONSTRAINT_ERROR = 4004,
69 
70  // Revocation errors
72  OCSP_CERT_NOT_LISTED = 4006,
73  OCSP_BAD_STATUS = 4007,
74 
75  // Other problems
76  CERT_NAME_NOMATCH = 4008,
79  OCSP_SIGNATURE_ERROR = 4501,
80  OCSP_ISSUER_NOT_FOUND = 4502,
82  OCSP_RESPONSE_INVALID = 4504,
83  EXT_IN_V1_V2_CERT = 4505,
84  DUPLICATE_CERT_POLICY = 4506,
86 
87  // Hard failures
88  CERT_IS_REVOKED = 5000,
89  CRL_BAD_SIGNATURE = 5001,
90  SIGNATURE_ERROR = 5002,
91  CERT_PUBKEY_INVALID = 5003,
94 };
95 
96 /**
97 * Convert a status code to a human readable diagnostic message
98 * @param code the certifcate status
99 * @return string literal constant, or nullptr if code unknown
100 */
101 BOTAN_PUBLIC_API(2,0) const char* to_string(Certificate_Status_Code code);
102 
103 }
104 
105 #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: cert_status.h:18