8#include <botan/get_pbe.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")
const HashFunction * prototype_hash_function(const std::string &algo_spec, const std::string &provider="")
const BlockCipher * prototype_block_cipher(const std::string &algo_spec, const std::string &provider="")
virtual BlockCipher * clone() const =0
virtual HashFunction * clone() const =0
Algorithm_Factory & algorithm_factory() const
std::string deref_alias(const std::string &alias) const
std::string as_string() const
PBE_PKCS5v15(BlockCipher *cipher, HashFunction *hash, Cipher_Dir direction)
PBE_PKCS5v20(DataSource &input)
virtual void decode_params(DataSource &src)=0
std::string arg(size_t i) const
std::string algo_name() const
std::string as_string() const
std::string lookup(const OID &oid)
std::invalid_argument Invalid_Argument
std::vector< std::string > split_on(const std::string &str, char delim)
Library_State & global_state()
PBE * get_pbe(const std::string &algo_spec)
Algorithm_Not_Found(const std::string &name)
Invalid_Algorithm_Name(const std::string &name)