diff options
author | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-05-18 18:33:19 +0000 |
commit | a2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch) | |
tree | ad3d6c4fcc8dd0f403f8105598943616246fe172 /include/x509_key.h |
Initial checkin1.5.6
Diffstat (limited to 'include/x509_key.h')
-rw-r--r-- | include/x509_key.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/x509_key.h b/include/x509_key.h new file mode 100644 index 000000000..b55ba69cc --- /dev/null +++ b/include/x509_key.h @@ -0,0 +1,48 @@ +/************************************************* +* X.509 Public Key Header File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#ifndef BOTAN_X509_PUBLIC_KEY_H__ +#define BOTAN_X509_PUBLIC_KEY_H__ + +#include <botan/pipe.h> +#include <botan/pk_keys.h> + +namespace Botan { + +/************************************************* +* X.509 Public Key * +*************************************************/ +class X509_PublicKey : public virtual PK_Key + { + public: + u64bit key_id() const; + virtual MemoryVector<byte> DER_encode_pub() const = 0; + virtual MemoryVector<byte> DER_encode_params() const = 0; + virtual void BER_decode_pub(DataSource&) = 0; + virtual void BER_decode_params(DataSource&) = 0; + virtual ~X509_PublicKey() {} + }; + +namespace X509 { + +/************************************************* +* X.509 Public Key Encoding/Decoding * +*************************************************/ +void encode(const X509_PublicKey&, Pipe&, X509_Encoding = PEM); +std::string PEM_encode(const X509_PublicKey&); + +X509_PublicKey* load_key(DataSource&); +X509_PublicKey* load_key(const std::string&); +X509_PublicKey* load_key(const MemoryRegion<byte>&); + +X509_PublicKey* copy_key(const X509_PublicKey&); + +Key_Constraints find_constraints(const X509_PublicKey&, Key_Constraints); + +} + +} + +#endif |