monotone

monotone Mtn Source Tree

Root/botan/pbe_pkcs.h

1/*************************************************
2* PKCS PBE Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_PBE_PKCS_H__
7#define BOTAN_PBE_PKCS_H__
8
9#include <botan/pbe.h>
10#include <botan/pipe.h>
11
12namespace Botan {
13
14/*************************************************
15* PKCS#5 v1.5 PBE *
16*************************************************/
17class PBE_PKCS5v15 : public PBE
18 {
19 public:
20 void write(const byte[], u32bit);
21 void start_msg();
22 void end_msg();
23 PBE_PKCS5v15(const std::string&, const std::string&, Cipher_Dir);
24 private:
25 void set_key(const std::string&);
26 void new_params();
27 MemoryVector<byte> encode_params() const;
28 void decode_params(DataSource&);
29 OID get_oid() const;
30 void flush_pipe(bool);
31 const Cipher_Dir direction;
32 const std::string digest, cipher;
33 SecureVector<byte> salt, key, iv;
34 u32bit iterations;
35 Pipe pipe;
36 };
37
38/*************************************************
39* PKCS#5 v2.0 PBE *
40*************************************************/
41class PBE_PKCS5v20 : public PBE
42 {
43 public:
44 void write(const byte[], u32bit);
45 void start_msg();
46 void end_msg();
47 PBE_PKCS5v20(DataSource&);
48 PBE_PKCS5v20(const std::string&, const std::string&);
49 private:
50 void set_key(const std::string&);
51 void new_params();
52 MemoryVector<byte> encode_params() const;
53 void decode_params(DataSource&);
54 OID get_oid() const;
55 void flush_pipe(bool);
56 bool known_cipher(const std::string&) const;
57
58 const Cipher_Dir direction;
59 std::string digest, cipher, cipher_algo;
60 SecureVector<byte> salt, key, iv;
61 u32bit iterations, key_length;
62 Pipe pipe;
63 };
64
65}
66
67#endif

Archive Download this file

Branches

Tags

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