aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/cvc/cvc_cert.h
blob: 17671d33277a7d22f869cdb858a59b525011a695 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* EAC1_1 CVC
* (C) 2008 Falko Strenzke
*     2008 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_CVC_EAC_H__
#define BOTAN_CVC_EAC_H__

#include <botan/x509_key.h>
#include <botan/pubkey_enums.h>
#include <botan/signed_obj.h>
#include <botan/pubkey.h>
#include <botan/ecdsa.h>
#include <botan/ecdsa_sig.h>
#include <botan/eac_obj.h>
#include <botan/cvc_gen_cert.h>
#include <string>

namespace Botan {

/**
* This class represents TR03110 (EAC) v1.1 CV Certificates
*/
class BOTAN_DLL EAC1_1_CVC : public EAC1_1_gen_CVC<EAC1_1_CVC>//Signed_Object
    {
    public:
       friend class EAC1_1_obj<EAC1_1_CVC>;

       /**
       * Get the CAR of the certificate.
       * @result the CAR of the certificate
       */
       ASN1_Car get_car() const;

       /**
       * Get the CED of this certificate.
       * @result the CED this certificate
       */
       ASN1_Ced get_ced() const;

       /**
       * Get the CEX of this certificate.
       * @result the CEX this certificate
       */
       ASN1_Cex get_cex() const;

       /**
       * Get the CHAT value.
       * @result the CHAT value
       */
       u32bit get_chat_value() const;

       bool operator==(const EAC1_1_CVC&) const;

       /**
       * Construct a CVC from a data source
       * @param source the data source
       */
       EAC1_1_CVC(std::tr1::shared_ptr<DataSource>& source);

       /**
       * Construct a CVC from a file
       * @param str the path to the certificate file
       */
       EAC1_1_CVC(const std::string& str);

       virtual ~EAC1_1_CVC() {}
    private:
       void force_decode();
       friend class EAC1_1_CVC_CA;
       EAC1_1_CVC() {}

       ASN1_Car m_car;
       ASN1_Ced m_ced;
       ASN1_Cex m_cex;
       byte m_chat_val;
       OID m_chat_oid;
    };

/*
* Comparison
*/
inline bool operator!=(EAC1_1_CVC const& lhs, EAC1_1_CVC const& rhs)
   {
   return !(lhs == rhs);
   }

}

#endif