aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/x509/x509_crl.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-11-14 09:20:28 -0500
committerJack Lloyd <[email protected]>2017-11-14 16:19:44 -0500
commitbc552d5ced2a3727c93070c82a87a4338f95e0db (patch)
treeaa7e92b84ad85c29c753b2a9f232ab582eb63fff /src/lib/x509/x509_crl.h
parent9f8e50700367bc7775f5cb1fee9dab787316411f (diff)
Store X509_CRL data in shared_ptr
Diffstat (limited to 'src/lib/x509/x509_crl.h')
-rw-r--r--src/lib/x509/x509_crl.h38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/lib/x509/x509_crl.h b/src/lib/x509/x509_crl.h
index 865117300..c3c986cc1 100644
--- a/src/lib/x509/x509_crl.h
+++ b/src/lib/x509/x509_crl.h
@@ -11,11 +11,12 @@
#include <botan/x509_obj.h>
#include <botan/x509_dn.h>
#include <botan/crl_ent.h>
-#include <botan/datastor.h>
#include <vector>
namespace Botan {
+class CRL_Data;
+class Extensions;
class X509_Certificate;
/**
@@ -43,19 +44,24 @@ class BOTAN_PUBLIC_API(2,0) X509_CRL final : public X509_Object
* 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;
+ const std::vector<CRL_Entry>& get_revoked() const;
/**
* Get the issuer DN of this CRL.
* @return CRLs issuer DN
*/
- X509_DN issuer_dn() const;
+ const X509_DN& issuer_dn() const;
+
+ /**
+ * @return extension data for this CRL
+ */
+ const Extensions& extensions() const;
/**
* Get the AuthorityKeyIdentifier of this CRL.
* @return this CRLs AuthorityKeyIdentifier
*/
- std::vector<uint8_t> authority_key_id() const;
+ const std::vector<uint8_t>& authority_key_id() const;
/**
* Get the serial number of this CRL.
@@ -67,41 +73,33 @@ class BOTAN_PUBLIC_API(2,0) X509_CRL final : public X509_Object
* Get the CRL's thisUpdate value.
* @return CRLs thisUpdate
*/
- X509_Time this_update() const;
+ const X509_Time& this_update() const;
/**
* Get the CRL's nextUpdate value.
* @return CRLs nextdUpdate
*/
- X509_Time next_update() const;
+ const 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);
+ X509_CRL(DataSource& source);
#if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
/**
* 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);
+ X509_CRL(const std::string& filename);
#endif
/**
* Construct a CRL from a binary vector
* @param vec the binary (DER) representation of the CRL
- * @param throw_on_unknown_critical should we throw an exception
- * if an unknown CRL extension marked as critical is encountered.
*/
- X509_CRL(const std::vector<uint8_t>& vec,
- bool throw_on_unknown_critical = false);
+ X509_CRL(const std::vector<uint8_t>& vec);
/**
* Construct a CRL
@@ -116,9 +114,9 @@ class BOTAN_PUBLIC_API(2,0) X509_CRL final : public X509_Object
private:
void force_decode() override;
- bool m_throw_on_unknown_critical;
- std::vector<CRL_Entry> m_revoked;
- Data_Store m_info;
+ const CRL_Data& data() const;
+
+ std::shared_ptr<CRL_Data> m_data;
};
}