Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::OCSP::Request Class Reference

`#include <ocsp.h>`

## Public Member Functions
std::string | base64_encode () const
std::vector< uint8_t > | BER_encode () const
const X509_Certificate & | issuer () const
const std::vector< uint8_t > & | issuer_key_hash () const
| Request (const X509_Certificate &issuer_cert, const X509_Certificate &subject_cert)
| Request (const X509_Certificate &issuer_cert, const BigInt &subject_serial)
const X509_Certificate & | subject () const

## Detailed Description

An OCSP request.

Definition at line 23 of file ocsp.h.

## Constructor & Destructor Documentation

Botan::OCSP::Request::Request | ( | const X509_Certificate & | issuer_cert,
|  | const X509_Certificate & | subject_cert
| ) |  |

Create an OCSP request.

Parameters

  issuer_cert | issuer certificate
  subject_cert | subject certificate

Definition at line 53 of file ocsp.cpp.

References Botan::X509_Certificate::issuer_dn(), and Botan::X509_Certificate::subject_dn().

54 :
55 m_issuer(issuer_cert),
56 m_certid(m_issuer, BigInt::decode(subject_cert.serial_number()))
57 {
58 if(subject_cert.issuer_dn() != issuer_cert.subject_dn())
59 throw Invalid_Argument("Invalid cert pair to OCSP::Request (mismatched issuer,subject args?)");
60 }
Botan::BigInt::decode
static BigInt decode(const uint8_t buf[], size_t length, Base base=Binary)
Definition: big_code.cpp:114

Botan::OCSP::Request::Request | ( | const X509_Certificate & | issuer_cert,
|  | const BigInt & | subject_serial
| ) |  |

Definition at line 62 of file ocsp.cpp.

63 :
64 m_issuer(issuer_cert),
65 m_certid(m_issuer, subject_serial)
66 {
67 }

## Member Function Documentation

std::string Botan::OCSP::Request::base64_encode | ( |  | ) | const

Returns
  Base64-encoded OCSP request

Definition at line 85 of file ocsp.cpp.

References Botan::base64_encode(), and BER_encode().

86 {
87 return Botan::base64_encode(BER_encode());
88 }
Botan::base64_encode
size_t base64_encode(char out[], const uint8_t in[], size_t input_length, size_t &input_consumed, bool final_inputs)
Definition: base64.cpp:35
Botan::OCSP::Request::BER_encode
std::vector< uint8_t > BER_encode() const
Definition: ocsp.cpp:69

std::vector< uint8_t > Botan::OCSP::Request::BER_encode | ( |  | ) | const

Returns
  BER-encoded OCSP request

Definition at line 69 of file ocsp.cpp.

References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::DER_Encoder::end_explicit(), Botan::DER_Encoder::get_contents_unlocked(), Botan::SEQUENCE, Botan::DER_Encoder::start_cons(), and Botan::DER_Encoder::start_explicit().

Referenced by base64_encode().

70 {
71 return DER_Encoder().start_cons(SEQUENCE)
72 .start_cons(SEQUENCE)
73 .start_explicit(0)
74 .encode(static_cast<size_t>(0)) // version #
75 .end_explicit()
76 .start_cons(SEQUENCE)
77 .start_cons(SEQUENCE)
78 .encode(m_certid)
79 .end_cons()
80 .end_cons()
81 .end_cons()
82 .end_cons().get_contents_unlocked();
83 }
Botan::SEQUENCE
Definition: asn1_obj.h:39

const X509_Certificate& Botan::OCSP::Request::issuer | ( |  | ) | const
| inline

Returns
  issuer certificate

Definition at line 50 of file ocsp.h.

50 { return m_issuer; }

const std::vector<uint8_t>& Botan::OCSP::Request::issuer_key_hash | ( |  | ) | const
| inline

Definition at line 57 of file ocsp.h.

58 { return m_certid.issuer_key_hash(); }
Botan::OCSP::CertID::issuer_key_hash
const std::vector< uint8_t > & issuer_key_hash() const
Definition: ocsp_types.h:34

const X509_Certificate& Botan::OCSP::Request::subject | ( |  | ) | const
| inline

Returns
  subject certificate

Definition at line 55 of file ocsp.h.

55 { throw Not_Implemented("Method have been deprecated"); }

The documentation for this class was generated from the following files:

- src/lib/x509/ocsp.h
- src/lib/x509/ocsp.cpp