8 #include <botan/get_pbe.h>
9 #include <botan/oids.h>
10 #include <botan/scan_name.h>
11 #include <botan/parsing.h>
12 #include <botan/libstate.h>
14 #if defined(BOTAN_HAS_PBE_PKCS_V15)
15 #include <botan/pbes1.h>
18 #if defined(BOTAN_HAS_PBE_PKCS_V20)
19 #include <botan/pbes2.h>
31 const std::string pbe = request.
algo_name();
32 std::string digest_name = request.
arg(0);
33 const std::string cipher = request.
arg(1);
35 std::vector<std::string> cipher_spec =
split_on(cipher,
'/');
36 if(cipher_spec.size() != 2)
40 const std::string cipher_mode = cipher_spec[1];
42 if(cipher_mode !=
"CBC")
58 #if defined(BOTAN_HAS_PBE_PKCS_V15)
59 if(pbe ==
"PBE-PKCS5v15")
61 hash_function->
clone(),
65 #if defined(BOTAN_HAS_PBE_PKCS_V20)
66 if(pbe ==
"PBE-PKCS5v20")
68 hash_function->
clone());
81 const std::string pbe = request.
algo_name();
83 #if defined(BOTAN_HAS_PBE_PKCS_V15)
84 if(pbe ==
"PBE-PKCS5v15")
89 std::string digest_name = request.
arg(0);
90 const std::string cipher = request.
arg(1);
92 std::vector<std::string> cipher_spec =
split_on(cipher,
'/');
93 if(cipher_spec.size() != 2)
97 const std::string cipher_mode = cipher_spec[1];
99 if(cipher_mode !=
"CBC")
115 hash_function->
clone(),
122 #if defined(BOTAN_HAS_PBE_PKCS_V20)
123 if(pbe ==
"PBE-PKCS5v20")
std::string arg(size_t i) const
virtual BlockCipher * clone() const =0
const BlockCipher * prototype_block_cipher(const std::string &algo_spec, const std::string &provider="")
std::vector< std::string > split_on(const std::string &str, char delim)
std::invalid_argument Invalid_Argument
virtual HashFunction * clone() const =0
Algorithm_Factory & algorithm_factory() const
std::string algo_name() const
const HashFunction * prototype_hash_function(const std::string &algo_spec, const std::string &provider="")
Library_State & global_state()
virtual void decode_params(DataSource &src)=0
std::string lookup(const OID &oid)
std::string deref_alias(const std::string &alias) const
std::string as_string() const
PBE * get_pbe(const std::string &algo_spec)
std::string as_string() const