/************************************************* * EAC1_1 CVC ADO Header File * * (C) 2008 Falko Strenzke * * strenzke@flexsecure.de * *************************************************/ #ifndef BOTAN_EAC_CVC_ADO_H__ #define BOTAN_EAC_CVC_ADO_H__ #include #include #include #include #include #include #include namespace Botan { /** * This class represents a TR03110 (EAC) v1.1 CVC ADO request */ // CRTP continuation from EAC1_1_obj class BOTAN_DLL EAC1_1_ADO : public EAC1_1_obj { friend class EAC1_1_obj; public: /** * Construct a CVC ADO request from a DER encoded CVC ADO request file. * @param str the path to the DER encoded file */ EAC1_1_ADO(const std::string& str); /** * Construct a CVC ADO request from a data source * @param source the data source */ EAC1_1_ADO(std::tr1::shared_ptr source); /** * Create a signed CVC ADO request from to be signed (TBS) data * @param signer the signer used to sign the CVC ADO request * @param tbs_bits the TBS data to sign */ static MemoryVector make_signed( std::auto_ptr signer, const MemoryRegion& tbs_bits, RandomNumberGenerator& rng); /** * Get the CAR of this CVC ADO request * @result the CAR of this CVC ADO request */ ASN1_Car get_car() const; /** * Get the CVC request contained in this object. * @result the CVC request inside this CVC ADO request */ EAC1_1_Req get_request() const; /** * Encode this object into a pipe. Only DER is supported. * @param out the pipe to encode this object into * @param encoding the encoding type to use, must be DER */ void encode(Pipe& out, X509_Encoding encoding) const; bool operator==(EAC1_1_ADO const& rhs) const; /** * Get the TBS data of this CVC ADO request. * @result the TBS data */ SecureVector tbs_data() const; virtual ~EAC1_1_ADO() {} private: ASN1_Car m_car; EAC1_1_Req m_req; void force_decode(); static void decode_info(SharedPtrConverter source, SecureVector & res_tbs_bits, ECDSA_Signature & res_sig); }; inline bool operator!=(EAC1_1_ADO const& lhs, EAC1_1_ADO const& rhs) { return (!(lhs == rhs)); } } #endif