diff options
author | lloyd <[email protected]> | 2010-06-28 19:54:46 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-06-28 19:54:46 +0000 |
commit | be41b79db735f10d09f5f73e4c2d438cee2d4ab7 (patch) | |
tree | cfdbaf5dbc183587331cc886d30640a050e76fdd /src/pbe | |
parent | 78465d7229c14478b81ecf56fad69a3b598a7415 (diff) |
Give all Filter objects a method for querying their name
Diffstat (limited to 'src/pbe')
-rw-r--r-- | src/pbe/pbes1/pbes1.cpp | 6 | ||||
-rw-r--r-- | src/pbe/pbes1/pbes1.h | 2 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.cpp | 6 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.h | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/src/pbe/pbes1/pbes1.cpp b/src/pbe/pbes1/pbes1.cpp index a3e08d679..6e4c3f54d 100644 --- a/src/pbe/pbes1/pbes1.cpp +++ b/src/pbe/pbes1/pbes1.cpp @@ -153,6 +153,12 @@ OID PBE_PKCS5v15::get_oid() const throw Internal_Error("PBE-PKCS5 v1.5: get_oid() has run out of options"); } +std::string PBE_PKCS5v15::name() const + { + return "PBE-PKCS5v15(" + block_cipher->name() + "," + + hash_function->name() + ")"; + } + /* * PKCS#5 v1.5 PBE Constructor */ diff --git a/src/pbe/pbes1/pbes1.h b/src/pbe/pbes1/pbes1.h index d50c01f53..dcce38e24 100644 --- a/src/pbe/pbes1/pbes1.h +++ b/src/pbe/pbes1/pbes1.h @@ -21,6 +21,8 @@ namespace Botan { class BOTAN_DLL PBE_PKCS5v15 : public PBE { public: + std::string name() const; + void write(const byte[], u32bit); void start_msg(); void end_msg(); diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp index 1ac16af8d..5b77acff5 100644 --- a/src/pbe/pbes2/pbes2.cpp +++ b/src/pbe/pbes2/pbes2.cpp @@ -207,6 +207,12 @@ bool PBE_PKCS5v20::known_cipher(const std::string& algo) return false; } +std::string PBE_PKCS5v20::name() const + { + return "PBE-PKCS5v20(" + block_cipher->name() + "," + + hash_function->name() + ")"; + } + /* * PKCS#5 v2.0 PBE Constructor */ diff --git a/src/pbe/pbes2/pbes2.h b/src/pbe/pbes2/pbes2.h index f24d572d0..4a021840a 100644 --- a/src/pbe/pbes2/pbes2.h +++ b/src/pbe/pbes2/pbes2.h @@ -27,6 +27,8 @@ class BOTAN_DLL PBE_PKCS5v20 : public PBE */ static bool known_cipher(const std::string& cipher); + std::string name() const; + void write(const byte[], u32bit); void start_msg(); void end_msg(); |