8 #include <botan/x509_crl.h>
9 #include <botan/x509_ext.h>
10 #include <botan/x509cert.h>
11 #include <botan/ber_dec.h>
12 #include <botan/parsing.h>
13 #include <botan/bigint.h>
14 #include <botan/oids.h>
22 X509_Object(in,
"X509 CRL/CRL"), m_throw_on_unknown_critical(touc)
27 #if defined(BOTAN_TARGET_OS_HAS_FILESYSTEM)
32 X509_Object(fsname,
"CRL/X509 CRL"), m_throw_on_unknown_critical(touc)
39 X509_Object(in,
"CRL/X509 CRL"), m_throw_on_unknown_critical(touc)
45 const X509_Time& nextUpdate,
const std::vector<CRL_Entry>& revoked) :
46 X509_Object(), m_throw_on_unknown_critical(false), m_revoked(revoked)
68 if(!crl_akid.empty() && !cert_akid.empty())
69 if(crl_akid != cert_akid)
76 for(
size_t i = 0; i != m_revoked.size(); ++i)
78 if(cert_serial == m_revoked[i].serial_number())
93 void X509_CRL::force_decode()
100 if(version != 0 && version != 1)
101 throw X509_CRL_Error(
"Unknown X.509 CRL version " +
105 tbs_crl.decode(sig_algo_inner);
108 throw X509_CRL_Error(
"Algorithm identifier mismatch");
111 tbs_crl.decode(dn_issuer);
115 tbs_crl.decode(start).decode(end);
125 while(cert_list.more_items())
127 CRL_Entry entry(m_throw_on_unknown_critical);
128 cert_list.decode(entry);
129 m_revoked.push_back(entry);
131 next = tbs_crl.get_next_object();
137 BER_Decoder crl_options(next.
value);
139 Extensions extensions(m_throw_on_unknown_critical);
141 crl_options.decode(extensions).verify_end();
143 extensions.contents_to(m_info, m_info);
145 next = tbs_crl.get_next_object();
149 throw X509_CRL_Error(
"Unknown tag in CRL");
151 tbs_crl.verify_end();
175 return m_info.
get1_memvec(
"X509v3.AuthorityKeyIdentifier");
AlgorithmIdentifier m_sig_algo
std::vector< uint8_t > get1_memvec(const std::string &) const
bool is_revoked(const X509_Certificate &cert) const
X509_Time this_update() const
std::vector< uint8_t > serial_number() const
uint32_t get1_uint32(const std::string &, uint32_t=0) const
X509_DN issuer_dn() const
std::string to_string(const BER_Object &obj)
std::string get1(const std::string &key) const
X509_Time next_update() const
std::vector< uint8_t > m_tbs_bits
secure_vector< uint8_t > value
X509_DN create_dn(const Data_Store &info)
X509_CRL(DataSource &source, bool throw_on_unknown_critical=false)
std::vector< CRL_Entry > get_revoked() const
std::string to_string() const
Return an internal string representation of the time.
std::vector< uint8_t > authority_key_id() const
X509_DN issuer_dn() const
std::multimap< std::string, std::string > contents() const
std::vector< uint8_t > authority_key_id() const
void add(const std::multimap< std::string, std::string > &)
uint32_t crl_number() const