aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-11-06 14:59:48 +0000
committerlloyd <[email protected]>2012-11-06 14:59:48 +0000
commit2458460b4478b7464dede87dc3beff8ea2838789 (patch)
treef399cb8e116b48d03909ae75b3e66a29c59ad0aa /src/cert
parent6b075b7655d818a29ce5c8168cd22e3bc30f219c (diff)
Split asn1_obj.h into asn1_alt_name.h, asn1_attribute.h, and
asn1_time.h
Diffstat (limited to 'src/cert')
-rw-r--r--src/cert/ocsp/ocsp_types.h1
-rw-r--r--src/cert/x509/crl_ent.h1
-rw-r--r--src/cert/x509/pkcs10.h2
-rw-r--r--src/cert/x509/x509_ext.h1
-rw-r--r--src/cert/x509/x509_obj.h2
-rw-r--r--src/cert/x509/x509cert.h1
-rw-r--r--src/cert/x509/x509path.h50
-rw-r--r--src/cert/x509/x509self.h1
8 files changed, 56 insertions, 3 deletions
diff --git a/src/cert/ocsp/ocsp_types.h b/src/cert/ocsp/ocsp_types.h
index 5a5beb567..e51089aca 100644
--- a/src/cert/ocsp/ocsp_types.h
+++ b/src/cert/ocsp/ocsp_types.h
@@ -9,6 +9,7 @@
#define BOTAN_OCSP_TYPES_H__
#include <botan/x509cert.h>
+#include <botan/asn1_time.h>
#include <botan/bigint.h>
namespace Botan {
diff --git a/src/cert/x509/crl_ent.h b/src/cert/x509/crl_ent.h
index 769519f78..e68008b70 100644
--- a/src/cert/x509/crl_ent.h
+++ b/src/cert/x509/crl_ent.h
@@ -9,6 +9,7 @@
#define BOTAN_CRL_ENTRY_H__
#include <botan/x509cert.h>
+#include <botan/asn1_time.h>
namespace Botan {
diff --git a/src/cert/x509/pkcs10.h b/src/cert/x509/pkcs10.h
index 974ea0070..b54425133 100644
--- a/src/cert/x509/pkcs10.h
+++ b/src/cert/x509/pkcs10.h
@@ -13,6 +13,8 @@
#include <botan/pkcs8.h>
#include <botan/datastor.h>
#include <botan/key_constraint.h>
+#include <botan/asn1_attribute.h>
+#include <botan/asn1_alt_name.h>
#include <vector>
namespace Botan {
diff --git a/src/cert/x509/x509_ext.h b/src/cert/x509/x509_ext.h
index 42434c4c2..07da1b8f8 100644
--- a/src/cert/x509/x509_ext.h
+++ b/src/cert/x509/x509_ext.h
@@ -10,7 +10,6 @@
#include <botan/asn1_int.h>
#include <botan/asn1_oid.h>
-#include <botan/asn1_obj.h>
#include <botan/datastor.h>
#include <botan/crl_ent.h>
diff --git a/src/cert/x509/x509_obj.h b/src/cert/x509/x509_obj.h
index 5905e1b37..42aead195 100644
--- a/src/cert/x509/x509_obj.h
+++ b/src/cert/x509/x509_obj.h
@@ -8,7 +8,7 @@
#ifndef BOTAN_X509_OBJECT_H__
#define BOTAN_X509_OBJECT_H__
-#include <botan/asn1_obj.h>
+#include <botan/asn1_int.h>
#include <botan/pipe.h>
#include <botan/x509_key.h>
#include <botan/rng.h>
diff --git a/src/cert/x509/x509cert.h b/src/cert/x509/x509cert.h
index 97758ea5a..bd341b6e0 100644
--- a/src/cert/x509/x509cert.h
+++ b/src/cert/x509/x509cert.h
@@ -11,6 +11,7 @@
#include <botan/x509_obj.h>
#include <botan/x509_dn.h>
#include <botan/x509_key.h>
+#include <botan/asn1_alt_name.h>
#include <botan/datastor.h>
#include <botan/key_constraint.h>
#include <map>
diff --git a/src/cert/x509/x509path.h b/src/cert/x509/x509path.h
index ae28599b0..829aa9d91 100644
--- a/src/cert/x509/x509path.h
+++ b/src/cert/x509/x509path.h
@@ -14,12 +14,30 @@
namespace Botan {
+/**
+* Specifies restrictions on the PKIX path validation
+*/
class BOTAN_DLL Path_Validation_Restrictions
{
public:
+ /**
+ * @param require_rev if true, revocation information is required
+ * @param minimum_key_strength is the minimum strength (in terms of
+ * operations, eg 80 means 2^80) of a signature. Signatures
+ * weaker than this are rejected.
+ */
Path_Validation_Restrictions(bool require_rev = false,
size_t minimum_key_strength = 80);
+ /**
+ * @param require_rev if true, revocation information is required
+ * @param minimum_key_strength is the minimum strength (in terms of
+ * operations, eg 80 means 2^80) of a signature. Signatures
+ * weaker than this are rejected.
+ * @param trusted_hashes a set of trusted hashes. Any signatures
+ * created using a hash other than one of these will be
+ * rejected.
+ */
Path_Validation_Restrictions(bool require_rev,
size_t minimum_key_strength,
const std::set<std::string>& trusted_hashes) :
@@ -42,6 +60,9 @@ class BOTAN_DLL Path_Validation_Restrictions
size_t m_minimum_key_strength;
};
+/**
+* Represents the result of a PKIX path validation
+*/
class BOTAN_DLL Path_Validation_Result
{
public:
@@ -79,19 +100,34 @@ class BOTAN_DLL Path_Validation_Result
};
/**
- * Returns the set of hash functions you are implicitly
+ * @return the set of hash functions you are implicitly
* trusting by trusting this result.
*/
std::set<std::string> trusted_hashes() const;
+ /**
+ * @return the trust root of the validation
+ */
const X509_Certificate& trust_root() const;
+ /**
+ * @return the full path from subject to trust root
+ */
const std::vector<X509_Certificate>& cert_path() const { return m_cert_path; }
+ /**
+ * @return true iff the validation was succesful
+ */
bool successful_validation() const { return result() == VERIFIED; }
+ /**
+ * @return validation result code
+ */
Code result() const { return m_result; }
+ /**
+ * @return string representation of the validation result
+ */
std::string result_string() const;
private:
@@ -109,21 +145,33 @@ class BOTAN_DLL Path_Validation_Result
std::vector<X509_Certificate> m_cert_path;
};
+/**
+* PKIX Path Validation
+*/
Path_Validation_Result BOTAN_DLL x509_path_validate(
const std::vector<X509_Certificate>& end_certs,
const Path_Validation_Restrictions& restrictions,
const std::vector<Certificate_Store*>& certstores);
+/**
+* PKIX Path Validation
+*/
Path_Validation_Result BOTAN_DLL x509_path_validate(
const X509_Certificate& end_cert,
const Path_Validation_Restrictions& restrictions,
const std::vector<Certificate_Store*>& certstores);
+/**
+* PKIX Path Validation
+*/
Path_Validation_Result BOTAN_DLL x509_path_validate(
const X509_Certificate& end_cert,
const Path_Validation_Restrictions& restrictions,
const Certificate_Store& store);
+/**
+* PKIX Path Validation
+*/
Path_Validation_Result BOTAN_DLL x509_path_validate(
const std::vector<X509_Certificate>& end_certs,
const Path_Validation_Restrictions& restrictions,
diff --git a/src/cert/x509/x509self.h b/src/cert/x509/x509self.h
index 2850096c8..eee4d10c6 100644
--- a/src/cert/x509/x509self.h
+++ b/src/cert/x509/x509self.h
@@ -11,6 +11,7 @@
#include <botan/x509cert.h>
#include <botan/pkcs8.h>
#include <botan/pkcs10.h>
+#include <botan/asn1_time.h>
namespace Botan {