monotone

monotone Mtn Source Tree

Root/botan/pkcs8.h

1/*************************************************
2* PKCS #8 Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_PKCS8_H__
7#define BOTAN_PKCS8_H__
8
9#include <botan/x509_key.h>
10#include <botan/ui.h>
11
12namespace Botan {
13
14/*************************************************
15* PKCS #8 Private Key *
16*************************************************/
17class PKCS8_PrivateKey : public virtual X509_PublicKey
18 {
19 public:
20 virtual SecureVector<byte> DER_encode_priv() const = 0;
21 virtual void BER_decode_priv(DataSource&) = 0;
22 virtual ~PKCS8_PrivateKey() {}
23 };
24
25/*************************************************
26* PKCS #8 General Exception *
27*************************************************/
28struct PKCS8_Exception : public Decoding_Error
29 {
30 PKCS8_Exception(const std::string& error) :
31 Decoding_Error("PKCS #8: " + error) {}
32 };
33
34namespace PKCS8 {
35
36/*************************************************
37* PKCS #8 Private Key Encoding/Decoding *
38*************************************************/
39void encode(const PKCS8_PrivateKey&, Pipe&, X509_Encoding = PEM);
40void encrypt_key(const PKCS8_PrivateKey&, Pipe&, const std::string&,
41 const std::string& = "", X509_Encoding = PEM);
42
43std::string PEM_encode(const PKCS8_PrivateKey&);
44std::string PEM_encode(const PKCS8_PrivateKey&, const std::string&,
45 const std::string& = "");
46
47PKCS8_PrivateKey* load_key(DataSource&, const User_Interface&,
48 bool encrypted = true);
49PKCS8_PrivateKey* load_key(DataSource&, const std::string& = "",
50 bool encrypted = true);
51
52PKCS8_PrivateKey* load_key(const std::string&, const User_Interface&,
53 bool encrypted = true);
54PKCS8_PrivateKey* load_key(const std::string&, const std::string& = "",
55 bool encrypted = true);
56
57PKCS8_PrivateKey* copy_key(const PKCS8_PrivateKey&);
58
59}
60
61}
62
63#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status