Botan 3.0.0-alpha0
Crypto and TLS for C&
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
12namespace 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 // Errors
35 FIRST_ERROR_STATUS = 1000,
36
38 UNTRUSTED_HASH = 1001,
39 NO_REVOCATION_DATA = 1002,
40 NO_MATCHING_CRLDP = 1003,
41
42 // Time problems
43 CERT_NOT_YET_VALID = 2000,
44 CERT_HAS_EXPIRED = 2001,
45 OCSP_NOT_YET_VALID = 2002,
46 OCSP_HAS_EXPIRED = 2003,
47 CRL_NOT_YET_VALID = 2004,
48 CRL_HAS_EXPIRED = 2005,
49 OCSP_IS_TOO_OLD = 2006,
50
51 // Chain generation problems
54 CERT_CHAIN_LOOP = 3002,
57
58 // Validation errors
59 POLICY_ERROR = 4000,
60 INVALID_USAGE = 4001,
64
65 // Revocation errors
68 OCSP_BAD_STATUS = 4007,
69
70 // Other problems
71 CERT_NAME_NOMATCH = 4008,
78 EXT_IN_V1_V2_CERT = 4505,
81
82 // Hard failures
83 CERT_IS_REVOKED = 5000,
84 CRL_BAD_SIGNATURE = 5001,
85 SIGNATURE_ERROR = 5002,
89};
90
91/**
92* Convert a status code to a human readable diagnostic message
93* @param code the certifcate status
94* @return string literal constant, or nullptr if code unknown
95*/
97
98/**
99* X.509v3 Key Constraints.
100* If updating update copy in ffi.h
101*/
108 KEY_AGREEMENT = 1 << 11,
109 KEY_CERT_SIGN = 1 << 10,
110 CRL_SIGN = 1 << 9,
112 DECIPHER_ONLY = 1 << 7
114
115/**
116* X.509v2 CRL Reason Code.
117*/
118enum class CRL_Code : uint32_t {
119 UNSPECIFIED = 0,
120 KEY_COMPROMISE = 1,
121 CA_COMPROMISE = 2,
123 SUPERSEDED = 4,
126 REMOVE_FROM_CRL = 8,
129 AA_COMPROMISE = 10,
130
131 DELETE_CRL_ENTRY = 0xFF00,
132 OCSP_GOOD = 0xFF01,
133 OCSP_UNKNOWN = 0xFF02
134};
135
136}
137
138#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Definition: alg_id.cpp:13
std::string to_string(ErrorType type)
Convert an ErrorType to string.
Definition: exceptn.cpp:11
Certificate_Status_Code
Definition: pkix_enums.h:17
Key_Constraints
Definition: pkix_enums.h:102
@ DATA_ENCIPHERMENT
Definition: pkix_enums.h:107
@ CRL_SIGN
Definition: pkix_enums.h:110
@ KEY_CERT_SIGN
Definition: pkix_enums.h:109
@ NO_CONSTRAINTS
Definition: pkix_enums.h:103
@ ENCIPHER_ONLY
Definition: pkix_enums.h:111
@ DIGITAL_SIGNATURE
Definition: pkix_enums.h:104
@ KEY_AGREEMENT
Definition: pkix_enums.h:108
@ DECIPHER_ONLY
Definition: pkix_enums.h:112
@ KEY_ENCIPHERMENT
Definition: pkix_enums.h:106
@ NON_REPUDIATION
Definition: pkix_enums.h:105