summaryrefslogtreecommitdiffstats
path: root/botan/build/botan/pbes2.h
diff options
context:
space:
mode:
authorKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
committerKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
commit9f034793bcfc51c2b7c1dd14db806f7258f9a9eb (patch)
tree63bd0f50ce5b77828ad8205eafd7b9412810499e /botan/build/botan/pbes2.h
parent619d92cfef29e653bfdf852e83888e50cfc4348f (diff)
parent65271649dbc90f3af1184ad1b23bdb64c0c07d07 (diff)
Merge branch 'master' of git://git-nokia.trolltech.com.au/qtsoftware/research/qtuitest
Diffstat (limited to 'botan/build/botan/pbes2.h')
-rw-r--r--botan/build/botan/pbes2.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/botan/build/botan/pbes2.h b/botan/build/botan/pbes2.h
new file mode 100644
index 0000000..fc460a2
--- /dev/null
+++ b/botan/build/botan/pbes2.h
@@ -0,0 +1,53 @@
+/*
+* PKCS #5 v2.0 PBE
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_PBE_PKCS_v20_H__
+#define BOTAN_PBE_PKCS_v20_H__
+
+#include <botan/pbe.h>
+#include <botan/block_cipher.h>
+#include <botan/hash.h>
+#include <botan/pipe.h>
+
+namespace Botan {
+
+/*
+* PKCS#5 v2.0 PBE
+*/
+class BOTAN_DLL PBE_PKCS5v20 : public PBE
+ {
+ public:
+ static bool known_cipher(const std::string&);
+
+ void write(const byte[], u32bit);
+ void start_msg();
+ void end_msg();
+
+ PBE_PKCS5v20(DataSource&);
+ PBE_PKCS5v20(BlockCipher*, HashFunction*);
+
+ ~PBE_PKCS5v20();
+ 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);
+
+ Cipher_Dir direction;
+ BlockCipher* block_cipher;
+ HashFunction* hash_function;
+ SecureVector<byte> salt, key, iv;
+ u32bit iterations, key_length;
+ Pipe pipe;
+ };
+
+}
+
+#endif