aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/cert/cvc/eac_obj.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-01-10 03:41:59 +0000
committerlloyd <[email protected]>2014-01-10 03:41:59 +0000
commit6894dca64c04936d07048c0e8cbf7e25858548c3 (patch)
tree5d572bfde9fe667dab14e3f04b5285a85d8acd95 /src/lib/cert/cvc/eac_obj.h
parent9efa3be92442afb3d0b69890a36c7f122df18eda (diff)
Move lib into src
Diffstat (limited to 'src/lib/cert/cvc/eac_obj.h')
-rw-r--r--src/lib/cert/cvc/eac_obj.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/cert/cvc/eac_obj.h b/src/lib/cert/cvc/eac_obj.h
new file mode 100644
index 000000000..42274446c
--- /dev/null
+++ b/src/lib/cert/cvc/eac_obj.h
@@ -0,0 +1,55 @@
+/*
+* EAC1_1 objects
+* (C) 2008 Falko Strenzke
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_EAC_OBJ_H__
+#define BOTAN_EAC_OBJ_H__
+
+#include <botan/signed_obj.h>
+#include <botan/ecdsa_sig.h>
+
+namespace Botan {
+
+/**
+* TR03110 v1.1 EAC CV Certificate
+*/
+template<typename Derived> // CRTP is used enable the call sequence:
+class EAC1_1_obj : public EAC_Signed_Object
+ {
+ public:
+ /**
+ * Return the signature as a concatenation of the encoded parts.
+ * @result the concatenated signature
+ */
+ std::vector<byte> get_concat_sig() const
+ { return m_sig.get_concatenation(); }
+
+ bool check_signature(class Public_Key& key) const
+ {
+ return EAC_Signed_Object::check_signature(key, m_sig.DER_encode());
+ }
+
+ protected:
+ ECDSA_Signature m_sig;
+
+ void init(DataSource& in)
+ {
+ try
+ {
+ Derived::decode_info(in, tbs_bits, m_sig);
+ }
+ catch(Decoding_Error)
+ {
+ throw Decoding_Error(PEM_label_pref + " decoding failed");
+ }
+ }
+
+ virtual ~EAC1_1_obj<Derived>(){}
+ };
+
+}
+
+#endif