Botan  2.13.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 * Warning: reflect any changes to this in botan_cert_status_code in ffi.h
18 */
20  OK = 0,
21  VERIFIED = 0,
22 
23  // Revocation status
27  OCSP_NO_HTTP = 4,
28 
29  // Warnings
32  DN_TOO_LONG = 501,
35 
36  // Typo versions of above - will be removed in future major release
39 
40  // Errors
41  FIRST_ERROR_STATUS = 1000,
42 
44  UNTRUSTED_HASH = 1001,
45  NO_REVOCATION_DATA = 1002,
46  NO_MATCHING_CRLDP = 1003,
47 
48  // Time problems
49  CERT_NOT_YET_VALID = 2000,
50  CERT_HAS_EXPIRED = 2001,
51  OCSP_NOT_YET_VALID = 2002,
52  OCSP_HAS_EXPIRED = 2003,
53  CRL_NOT_YET_VALID = 2004,
54  CRL_HAS_EXPIRED = 2005,
55  OCSP_IS_TOO_OLD = 2006,
56 
57  // Chain generation problems
58  CERT_ISSUER_NOT_FOUND = 3000,
60  CERT_CHAIN_LOOP = 3002,
62  CHAIN_NAME_MISMATCH = 3004,
63 
64  // Validation errors
65  POLICY_ERROR = 4000,
66  INVALID_USAGE = 4001,
67  CERT_CHAIN_TOO_LONG = 4002,
69  NAME_CONSTRAINT_ERROR = 4004,
70 
71  // Revocation errors
73  OCSP_CERT_NOT_LISTED = 4006,
74  OCSP_BAD_STATUS = 4007,
75 
76  // Other problems
77  CERT_NAME_NOMATCH = 4008,
80  OCSP_SIGNATURE_ERROR = 4501,
81  OCSP_ISSUER_NOT_FOUND = 4502,
83  OCSP_RESPONSE_INVALID = 4504,
84  EXT_IN_V1_V2_CERT = 4505,
85  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:19