monotone

monotone Mtn Source Tree

Root/botan/pkcs8.h

1/*************************************************
2* PKCS #8 Header File *
3* (C) 1999-2006 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 Encoder *
16*************************************************/
17class PKCS8_Encoder
18 {
19 public:
20 virtual AlgorithmIdentifier alg_id() const = 0;
21 virtual MemoryVector<byte> key_bits() const = 0;
22 virtual ~PKCS8_Encoder() {}
23 };
24
25/*************************************************
26* PKCS #8 Private Key Decoder *
27*************************************************/
28class PKCS8_Decoder
29 {
30 public:
31 virtual void alg_id(const AlgorithmIdentifier&) = 0;
32 virtual void key_bits(const MemoryRegion<byte>&) = 0;
33 virtual ~PKCS8_Decoder() {}
34 };
35
36/*************************************************
37* PKCS #8 General Exception *
38*************************************************/
39struct PKCS8_Exception : public Decoding_Error
40 {
41 PKCS8_Exception(const std::string& error) :
42 Decoding_Error("PKCS #8: " + error) {}
43 };
44
45namespace PKCS8 {
46
47/*************************************************
48* PKCS #8 Private Key Encoding/Decoding *
49*************************************************/
50void encode(const Private_Key&, Pipe&, X509_Encoding = PEM);
51void encrypt_key(const Private_Key&, Pipe&, const std::string&,
52 const std::string& = "", X509_Encoding = PEM);
53
54std::string PEM_encode(const Private_Key&);
55std::string PEM_encode(const Private_Key&, const std::string&,
56 const std::string& = "");
57
58Private_Key* load_key(DataSource&, const User_Interface&);
59Private_Key* load_key(DataSource&, const std::string& = "");
60
61Private_Key* load_key(const std::string&, const User_Interface&);
62Private_Key* load_key(const std::string&, const std::string& = "");
63
64Private_Key* copy_key(const Private_Key&);
65
66}
67
68}
69
70#endif

Archive Download this file

Branches

Tags

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