diff options
-rw-r--r-- | src/pbe/pbes1/modinfo.txt | 10 | ||||
-rw-r--r-- | src/pbe/pbes2/modinfo.txt | 10 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.h | 45 |
3 files changed, 65 insertions, 0 deletions
diff --git a/src/pbe/pbes1/modinfo.txt b/src/pbe/pbes1/modinfo.txt new file mode 100644 index 000000000..187fac802 --- /dev/null +++ b/src/pbe/pbes1/modinfo.txt @@ -0,0 +1,10 @@ +realname "PKCS5 v1.5 PBE" + +define PBE_PKCS_V15 + +load_on auto + +<add> +pbes1.cpp +pbes1.h +</add> diff --git a/src/pbe/pbes2/modinfo.txt b/src/pbe/pbes2/modinfo.txt new file mode 100644 index 000000000..ee421363a --- /dev/null +++ b/src/pbe/pbes2/modinfo.txt @@ -0,0 +1,10 @@ +realname "PKCS5 v2.0 PBE" + +define PBE_PKCS_V20 + +load_on auto + +<add> +pbes2.cpp +pbes2.h +</add> diff --git a/src/pbe/pbes2/pbes2.h b/src/pbe/pbes2/pbes2.h new file mode 100644 index 000000000..36ba67b01 --- /dev/null +++ b/src/pbe/pbes2/pbes2.h @@ -0,0 +1,45 @@ +/************************************************* +* PKCS #5 v2.0 PBE Header File * +* (C) 1999-2007 Jack Lloyd * +*************************************************/ + +#ifndef BOTAN_PBE_PKCS_v20_H__ +#define BOTAN_PBE_PKCS_v20_H__ + +#include <botan/pbe.h> +#include <botan/pipe.h> +#include <botan/enums.h> + +namespace Botan { + +/************************************************* +* PKCS#5 v2.0 PBE * +*************************************************/ +class BOTAN_DLL PBE_PKCS5v20 : public PBE + { + public: + void write(const byte[], u32bit); + void start_msg(); + void end_msg(); + PBE_PKCS5v20(DataSource&); + PBE_PKCS5v20(const std::string&, const std::string&); + private: + void set_key(const std::string&); + void new_params(RandomNumberGenerator& rng); + MemoryVector<byte> encode_params() const; + void decode_params(DataSource&); + OID get_oid() const; + + void flush_pipe(bool); + bool known_cipher(const std::string&) const; + + const Cipher_Dir direction; + std::string digest, cipher, cipher_algo; + SecureVector<byte> salt, key, iv; + u32bit iterations, key_length; + Pipe pipe; + }; + +} + +#endif |