aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/cert/x509/x509cert.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-10-23 15:32:15 -0400
committerJack Lloyd <[email protected]>2015-10-23 15:32:15 -0400
commit3e44cbed78eb528daa38f9837d67aa0471ee7bd2 (patch)
tree01539aa0dd511db79e6d218394ea3fd51db94756 /src/lib/cert/x509/x509cert.h
parent69a5a56b38a309241126641149471a36137507a0 (diff)
Fix cert validation bugs found by x509test.
Add test suite with certs from x509test
Diffstat (limited to 'src/lib/cert/x509/x509cert.h')
-rw-r--r--src/lib/cert/x509/x509cert.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/cert/x509/x509cert.h b/src/lib/cert/x509/x509cert.h
index 9fd3e660a..d57d4f23f 100644
--- a/src/lib/cert/x509/x509cert.h
+++ b/src/lib/cert/x509/x509cert.h
@@ -1,6 +1,6 @@
/*
* X.509 Certificates
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2007,2015 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
@@ -18,6 +18,15 @@
namespace Botan {
+enum class Usage_Type
+ {
+ UNSPECIFIED, // no restrictions
+ TLS_SERVER_AUTH,
+ TLS_CLIENT_AUTH,
+ CERTIFICATE_AUTHORITY,
+ OCSP_RESPONDER
+ };
+
/**
* This class represents X.509 Certificate
*/
@@ -137,6 +146,8 @@ class BOTAN_DLL X509_Certificate : public X509_Object
*/
bool allowed_usage(const std::string& usage) const;
+ bool allowed_usage(Usage_Type usage) const;
+
/**
* Get the path limit as defined in the BasicConstraints extension of
* this certificate.