Botan: src/cert/cvc/eac_obj.h Source File

Botan 1.10.17

eac_obj.h
Go to the documentation of this file.
1 /*
2 * EAC1_1 objects
3 * (C) 2008 Falko Strenzke
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_EAC_OBJ_H__
9 #define BOTAN_EAC_OBJ_H__
10
11 #include <botan/signed_obj.h>
12 #include <botan/ecdsa_sig.h>
13
14 namespace Botan {
15
16 /**
17 * TR03110 v1.1 EAC CV Certificate
18 */
19 template<typename Derived> // CRTP is used enable the call sequence:
20 class EAC1_1_obj : public EAC_Signed_Object
21 {
22 public:
23 /**
24 * Return the signature as a concatenation of the encoded parts.
25 * @result the concatenated signature
26 */
27 SecureVector<byte> get_concat_sig() const
28 { return m_sig.get_concatenation(); }
29
30 bool check_signature(class Public_Key& key) const
31 {
32 return EAC_Signed_Object::check_signature(key, m_sig.DER_encode());
33 }
34
35 protected:
36 ECDSA_Signature m_sig;
37
38 void init(DataSource& in)
39 {
40 try
41 {
42 Derived::decode_info(in, tbs_bits, m_sig);
43 }
44 catch(Decoding_Error)
45 {
46 throw Decoding_Error(PEM_label_pref + " decoding failed");
47 }
48 }
49
50 virtual ~EAC1_1_obj<Derived>(){}
51 };
52
53 }
54
55 #endif
Botan::EAC1_1_obj::get_concat_sig
SecureVector< byte > get_concat_sig() const
Definition: eac_obj.h:27
Botan::EAC1_1_obj::init
void init(DataSource &in)
Definition: eac_obj.h:38
Botan::EAC_Signed_Object::check_signature
bool check_signature(class Public_Key &key, const MemoryRegion< byte > &sig) const
Definition: signed_obj.cpp:48
Botan::EAC1_1_obj::m_sig
ECDSA_Signature m_sig
Definition: eac_obj.h:36
Botan::DataSource
Definition: data_src.h:20
Botan::ECDSA_Signature::DER_encode
MemoryVector< byte > DER_encode() const
Definition: ecdsa_sig.cpp:23
Botan::ECDSA_Signature::get_concatenation
MemoryVector< byte > get_concatenation() const
Definition: ecdsa_sig.cpp:33
Botan::EAC1_1_obj::check_signature
bool check_signature(class Public_Key &key) const
Definition: eac_obj.h:30
Botan::Decoding_Error
Definition: exceptn.h:138
Botan::EAC_Signed_Object::PEM_label_pref
std::string PEM_label_pref
Definition: signed_obj.h:87
Botan
Definition: algo_base.h:14
Botan::Public_Key
Definition: pk_keys.h:21
Botan::EAC1_1_obj
Definition: eac_obj.h:20
Botan::SecureVector< byte >
Botan::EAC_Signed_Object::tbs_bits
SecureVector< byte > tbs_bits
Definition: signed_obj.h:86
Botan::EAC_Signed_Object
Definition: signed_obj.h:22
Botan::ECDSA_Signature
Definition: ecdsa_sig.h:21