Botan  1.10.9
pbe.h
Go to the documentation of this file.
1 /*
2 * PBE
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_PBE_BASE_H__
9 #define BOTAN_PBE_BASE_H__
10 
11 #include <botan/asn1_oid.h>
12 #include <botan/data_src.h>
13 #include <botan/filter.h>
14 #include <botan/rng.h>
15 
16 namespace Botan {
17 
18 /**
19 * Password Based Encryption (PBE) Filter.
20 */
21 class BOTAN_DLL PBE : public Filter
22  {
23  public:
24  /**
25  * Set this filter's key.
26  * @param pw the password to be used for the encryption
27  */
28  virtual void set_key(const std::string& pw) = 0;
29 
30  /**
31  * Create a new random salt value and set the default iterations value.
32  * @param rng a random number generator
33  */
34  virtual void new_params(RandomNumberGenerator& rng) = 0;
35 
36  /**
37  * DER encode the params (the number of iterations and the salt value)
38  * @return encoded params
39  */
40  virtual MemoryVector<byte> encode_params() const = 0;
41 
42  /**
43  * Decode params and use them inside this Filter.
44  * @param src a data source to read the encoded params from
45  */
46  virtual void decode_params(DataSource& src) = 0;
47 
48  /**
49  * Get this PBE's OID.
50  * @return object identifier
51  */
52  virtual OID get_oid() const = 0;
53  };
54 
55 }
56 
57 #endif
RandomNumberGenerator * rng
Definition: global_rng.cpp:165
Definition: pbe.h:21