/************************************************* * X.509 SIGNED Object Header File * * (C) 1999-2007 Jack Lloyd * *************************************************/ #ifndef BOTAN_X509_OBJECT_H__ #define BOTAN_X509_OBJECT_H__ #include #include #include #include namespace Botan { /************************************************* * Generic X.509 SIGNED Object * *************************************************/ class BOTAN_DLL X509_Object { public: SecureVector tbs_data() const; SecureVector signature() const; AlgorithmIdentifier signature_algorithm() const; static MemoryVector make_signed(class PK_Signer*, const AlgorithmIdentifier&, const MemoryRegion&); bool check_signature(class Public_Key&) const; void encode(Pipe&, X509_Encoding = PEM) const; SecureVector BER_encode() const; std::string PEM_encode() const; X509_Object(DataSource&, const std::string&); X509_Object(const std::string&, const std::string&); virtual ~X509_Object() {} protected: void do_decode(); X509_Object() {} AlgorithmIdentifier sig_algo; SecureVector tbs_bits, sig; private: virtual void force_decode() = 0; void init(DataSource&, const std::string&); void decode_info(DataSource&); std::vector PEM_labels_allowed; std::string PEM_label_pref; }; } #endif