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/pkcs8.h |
Initial checkin1.5.6
Diffstat (limited to 'include/pkcs8.h')
-rw-r--r-- | include/pkcs8.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/include/pkcs8.h b/include/pkcs8.h new file mode 100644 index 000000000..dc70acbe4 --- /dev/null +++ b/include/pkcs8.h @@ -0,0 +1,59 @@ +/************************************************* +* PKCS #8 Header File * +* (C) 1999-2006 The Botan Project * +*************************************************/ + +#ifndef BOTAN_PKCS8_H__ +#define BOTAN_PKCS8_H__ + +#include <botan/x509_key.h> +#include <botan/ui.h> + +namespace Botan { + +/************************************************* +* PKCS #8 Private Key * +*************************************************/ +class PKCS8_PrivateKey : public virtual X509_PublicKey + { + public: + virtual SecureVector<byte> DER_encode_priv() const = 0; + virtual void BER_decode_priv(DataSource&) = 0; + virtual ~PKCS8_PrivateKey() {} + }; + +/************************************************* +* PKCS #8 General Exception * +*************************************************/ +struct PKCS8_Exception : public Decoding_Error + { + PKCS8_Exception(const std::string& error) : + Decoding_Error("PKCS #8: " + error) {} + }; + +namespace PKCS8 { + +/************************************************* +* PKCS #8 Private Key Encoding/Decoding * +*************************************************/ +void encode(const PKCS8_PrivateKey&, Pipe&, X509_Encoding = PEM); +void encrypt_key(const PKCS8_PrivateKey&, Pipe&, const std::string&, + const std::string& = "", X509_Encoding = PEM); + +std::string PEM_encode(const PKCS8_PrivateKey&); +std::string PEM_encode(const PKCS8_PrivateKey&, const std::string&, + const std::string& = ""); + +PKCS8_PrivateKey* load_key(DataSource&, const User_Interface&); +PKCS8_PrivateKey* load_key(DataSource&, const std::string& = ""); + +PKCS8_PrivateKey* load_key(const std::string&, const User_Interface&); +PKCS8_PrivateKey* load_key(const std::string&, const std::string& = ""); + +PKCS8_PrivateKey* copy_key(const PKCS8_PrivateKey&); + +} + +} + +#endif |