Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

ocsp_types.h
Go to the documentation of this file.
1 /*
2 * OCSP subtypes
3 * (C) 2012 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_OCSP_TYPES_H__
9 #define BOTAN_OCSP_TYPES_H__
10
11 #include <botan/x509cert.h>
12 #include <botan/asn1_time.h>
13 #include <botan/bigint.h>
14
15 namespace Botan {
16
17 namespace OCSP {
18
19 class BOTAN_DLL CertID final : public ASN1_Object
20 {
21 public:
22 CertID() = default;
23
24 CertID(const X509_Certificate& issuer,
25 const BigInt& subject_serial);
26
27 bool is_id_for(const X509_Certificate& issuer,
28 const X509_Certificate& subject) const;
29
30 void encode_into(class DER_Encoder& to) const override;
31
32 void decode_from(class BER_Decoder& from) override;
33
34 const std::vector<uint8_t>& issuer_key_hash() const { return m_issuer_key_hash; }
35
36 private:
37 AlgorithmIdentifier m_hash_id;
38 std::vector<uint8_t> m_issuer_dn_hash;
39 std::vector<uint8_t> m_issuer_key_hash;
40 BigInt m_subject_serial;
41 };
42
43 class BOTAN_DLL SingleResponse final : public ASN1_Object
44 {
45 public:
46 const CertID& certid() const { return m_certid; }
47
48 size_t cert_status() const { return m_cert_status; }
49
50 X509_Time this_update() const { return m_thisupdate; }
51
52 X509_Time next_update() const { return m_nextupdate; }
53
54 void encode_into(class DER_Encoder& to) const override;
55
56 void decode_from(class BER_Decoder& from) override;
57 private:
58 CertID m_certid;
59 size_t m_cert_status = 2; // unknown
60 X509_Time m_thisupdate;
61 X509_Time m_nextupdate;
62 };
63
64 }
65
66 }
67
68 #endif
Botan::OCSP::CertID
Definition: ocsp_types.h:19
Botan::ASN1_Object
Definition: asn1_obj.h:61
Botan::BigInt
Definition: bigint.h:23
m_hash_id
std::vector< uint8_t > m_hash_id
Definition: tpm.cpp:440
Botan::OCSP::SingleResponse::certid
const CertID & certid() const
Definition: ocsp_types.h:46
Botan::DER_Encoder
Definition: der_enc.h:22
Botan::X509_Certificate
Definition: x509cert.h:36
Botan
Definition: alg_id.cpp:13
Botan::OCSP::SingleResponse
Definition: ocsp_types.h:43
Botan::OCSP::SingleResponse::next_update
X509_Time next_update() const
Definition: ocsp_types.h:52
Botan::AlgorithmIdentifier
Definition: alg_id.h:20
Botan::OCSP::SingleResponse::this_update
X509_Time this_update() const
Definition: ocsp_types.h:50
Botan::BER_Decoder
Definition: ber_dec.h:19
Botan::OCSP::SingleResponse::cert_status
size_t cert_status() const
Definition: ocsp_types.h:48
Botan::X509_Time
Definition: asn1_time.h:19
Botan::OCSP::CertID::issuer_key_hash
const std::vector< uint8_t > & issuer_key_hash() const
Definition: ocsp_types.h:34