aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509/x509_crl.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-02-06 19:30:38 +0000
committerlloyd <[email protected]>2012-02-06 19:30:38 +0000
commitf1a2b5a7b5f35322927446d1b9a381f05cc677df (patch)
tree905b125d9173a32c4a3b758ae124ded0d045d635 /src/cert/x509/x509_crl.h
parentcd58927000ef86eacc9de5b80f361d4d05e71731 (diff)
All of the X509 modules were actually mutually dependent. Ideally this
would be fixed but it's quite hard to do, makes more sense for now to merge then back into one big x509 blog.
Diffstat (limited to 'src/cert/x509/x509_crl.h')
-rw-r--r--src/cert/x509/x509_crl.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/cert/x509/x509_crl.h b/src/cert/x509/x509_crl.h
new file mode 100644
index 000000000..55eb8424b
--- /dev/null
+++ b/src/cert/x509/x509_crl.h
@@ -0,0 +1,101 @@
+/*
+* X.509 CRL
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_X509_CRL_H__
+#define BOTAN_X509_CRL_H__
+
+#include <botan/x509_obj.h>
+#include <botan/crl_ent.h>
+#include <vector>
+
+namespace Botan {
+
+class X509_Certificate;
+
+/**
+* This class represents X.509 Certificate Revocation Lists (CRLs).
+*/
+class BOTAN_DLL X509_CRL : public X509_Object
+ {
+ public:
+ /**
+ * This class represents CRL related errors.
+ */
+ struct BOTAN_DLL X509_CRL_Error : public Exception
+ {
+ X509_CRL_Error(const std::string& error) :
+ Exception("X509_CRL: " + error) {}
+ };
+
+ /**
+ * Check if this particular certificate is listed in the CRL
+ */
+ bool is_revoked(const X509_Certificate& cert) const;
+
+ /**
+ * Get the entries of this CRL in the form of a vector.
+ * @return vector containing the entries of this CRL.
+ */
+ std::vector<CRL_Entry> get_revoked() const;
+
+ /**
+ * Get the issuer DN of this CRL.
+ * @return CRLs issuer DN
+ */
+ X509_DN issuer_dn() const;
+
+ /**
+ * Get the AuthorityKeyIdentifier of this CRL.
+ * @return this CRLs AuthorityKeyIdentifier
+ */
+ MemoryVector<byte> authority_key_id() const;
+
+ /**
+ * Get the serial number of this CRL.
+ * @return CRLs serial number
+ */
+ u32bit crl_number() const;
+
+ /**
+ * Get the CRL's thisUpdate value.
+ * @return CRLs thisUpdate
+ */
+ X509_Time this_update() const;
+
+ /**
+ * Get the CRL's nextUpdate value.
+ * @return CRLs nextdUpdate
+ */
+ X509_Time next_update() const;
+
+ /**
+ * Construct a CRL from a data source.
+ * @param source the data source providing the DER or PEM encoded CRL.
+ * @param throw_on_unknown_critical should we throw an exception
+ * if an unknown CRL extension marked as critical is encountered.
+ */
+ X509_CRL(DataSource& source, bool throw_on_unknown_critical = false);
+
+ /**
+ * Construct a CRL from a file containing the DER or PEM encoded CRL.
+ * @param filename the name of the CRL file
+ * @param throw_on_unknown_critical should we throw an exception
+ * if an unknown CRL extension marked as critical is encountered.
+ */
+ X509_CRL(const std::string& filename,
+ bool throw_on_unknown_critical = false);
+ private:
+ void force_decode();
+
+ bool throw_on_unknown_critical;
+ std::vector<CRL_Entry> revoked;
+ Data_Store info;
+ };
+
+}
+
+#endif