Botan 1.10.17
cvc_req.cpp
Go to the documentation of this file.
1/*
2 (C) 2007 FlexSecure GmbH
3 2008-2010 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#include <botan/cvc_req.h>
9#include <botan/cvc_cert.h>
10#include <botan/ber_dec.h>
11
12namespace Botan {
13
14bool EAC1_1_Req::operator==(EAC1_1_Req const& rhs) const
15 {
16 return (this->tbs_data() == rhs.tbs_data() &&
17 this->get_concat_sig() == rhs.get_concat_sig());
18 }
19
20void EAC1_1_Req::force_decode()
21 {
22 SecureVector<byte> enc_pk;
23 BER_Decoder tbs_cert(tbs_bits);
24 size_t cpi;
25 tbs_cert.decode(cpi, ASN1_Tag(41), APPLICATION)
26 .start_cons(ASN1_Tag(73))
27 .raw_bytes(enc_pk)
28 .end_cons()
29 .decode(m_chr)
30 .verify_end();
31
32 if(cpi != 0)
33 throw Decoding_Error("EAC1_1 requests cpi was not 0");
34
36 }
37
39 {
40 init(in);
41 self_signed = true;
42 do_decode();
43 }
44
45EAC1_1_Req::EAC1_1_Req(const std::string& in)
46 {
47 DataSource_Stream stream(in, true);
48 init(stream);
49 self_signed = true;
50 do_decode();
51 }
52
53}
EAC1_1_Req(DataSource &source)
Definition cvc_req.cpp:38
bool operator==(const EAC1_1_Req &other) const
Definition cvc_req.cpp:14
SecureVector< byte > tbs_data() const
void init(DataSource &in)
Definition eac_obj.h:38
SecureVector< byte > get_concat_sig() const
Definition eac_obj.h:27
SecureVector< byte > tbs_bits
Definition signed_obj.h:86
ECDSA_PublicKey * decode_eac1_1_key(const MemoryRegion< byte > &, AlgorithmIdentifier &)
Definition cvc_cert.cpp:91
ASN1_Tag
Definition asn1_int.h:19
@ APPLICATION
Definition asn1_int.h:21
Decoding_Error(const std::string &name)
Definition exceptn.h:140