Botan
1.10.17
src
pbe
pbes1
pbes1.h
Go to the documentation of this file.
1
/*
2
* PKCS #5 v1.5 PBE
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Distributed under the terms of the Botan license
6
*/
7
8
#ifndef BOTAN_PBE_PKCS_V15_H__
9
#define BOTAN_PBE_PKCS_V15_H__
10
11
#include <botan/pbe.h>
12
#include <botan/block_cipher.h>
13
#include <botan/hash.h>
14
#include <botan/pipe.h>
15
16
namespace
Botan
{
17
18
/**
19
* PKCS #5 v1.5 PBE
20
*/
21
class
BOTAN_DLL
PBE_PKCS5v15
:
public
PBE
22
{
23
public
:
24
std::string
name
()
const
;
25
26
void
write
(
const
byte
[],
size_t
);
27
void
start_msg
();
28
void
end_msg
();
29
30
/**
31
* @param cipher the block cipher to use (DES or RC2)
32
* @param hash the hash function to use
33
* @param direction are we encrypting or decrypting
34
*/
35
PBE_PKCS5v15
(
BlockCipher
* cipher,
36
HashFunction
* hash,
37
Cipher_Dir
direction);
38
39
~PBE_PKCS5v15
();
40
private
:
41
void
set_key(
const
std::string&);
42
void
new_params(
RandomNumberGenerator
& rng);
43
MemoryVector<byte>
encode_params()
const
;
44
void
decode_params(
DataSource
&);
45
OID
get_oid()
const
;
46
47
void
flush_pipe(
bool
);
48
49
Cipher_Dir
direction;
50
BlockCipher
* block_cipher;
51
HashFunction
* hash_function;
52
53
SecureVector<byte>
salt, key, iv;
54
size_t
iterations;
55
Pipe
pipe;
56
};
57
58
}
59
60
#endif
Botan::BlockCipher
Definition
block_cipher.h:19
Botan::DataSource
Definition
data_src.h:21
Botan::HashFunction
Definition
hash.h:22
Botan::MemoryVector
Definition
secmem.h:274
Botan::OID
Definition
asn1_oid.h:21
Botan::PBE_PKCS5v15::write
void write(const byte[], size_t)
Definition
pbes1.cpp:20
Botan::PBE_PKCS5v15::name
std::string name() const
Definition
pbes1.cpp:152
Botan::PBE_PKCS5v15::PBE_PKCS5v15
PBE_PKCS5v15(BlockCipher *cipher, HashFunction *hash, Cipher_Dir direction)
Definition
pbes1.cpp:161
Botan::PBE_PKCS5v15::start_msg
void start_msg()
Definition
pbes1.cpp:29
Botan::PBE_PKCS5v15::end_msg
void end_msg()
Definition
pbes1.cpp:48
Botan::PBE
Definition
pbe.h:22
Botan::Pipe
Definition
pipe.h:26
Botan::RandomNumberGenerator
Definition
rng.h:21
Botan::SecureVector
Definition
secmem.h:329
Botan
Definition
algo_base.h:14
Botan::Cipher_Dir
Cipher_Dir
Definition
sym_algo.h:87
Generated by
1.18.0