Botan  2.7.0
Crypto and TLS for C++11
pk_algs.h
Go to the documentation of this file.
1 /*
2 * PK Key Factory
3 * (C) 1999-2010,2016 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_PK_KEY_FACTORY_H_
9 #define BOTAN_PK_KEY_FACTORY_H_
10 
11 #include <botan/pk_keys.h>
12 #include <botan/alg_id.h>
13 #include <memory>
14 
15 namespace Botan {
16 
17 BOTAN_PUBLIC_API(2,0) std::unique_ptr<Public_Key>
18 load_public_key(const AlgorithmIdentifier& alg_id,
19  const std::vector<uint8_t>& key_bits);
20 
21 BOTAN_PUBLIC_API(2,0) std::unique_ptr<Private_Key>
22 load_private_key(const AlgorithmIdentifier& alg_id,
23  const secure_vector<uint8_t>& key_bits);
24 
25 /**
26 * Create a new key
27 * For ECC keys, algo_params specifies EC group (eg, "secp256r1")
28 * For DH/DSA/ElGamal keys, algo_params is DL group (eg, "modp/ietf/2048")
29 * For RSA, algo_params is integer keylength
30 * For McEliece, algo_params is n,t
31 * If algo_params is left empty, suitable default parameters are chosen.
32 */
33 BOTAN_PUBLIC_API(2,0) std::unique_ptr<Private_Key>
34 create_private_key(const std::string& algo_name,
35  RandomNumberGenerator& rng,
36  const std::string& algo_params = "",
37  const std::string& provider = "");
38 
40 std::vector<std::string>
41 probe_provider_private_key(const std::string& algo_name,
42  const std::vector<std::string> possible);
43 
44 }
45 
46 #endif
std::unique_ptr< Private_Key > load_private_key(const AlgorithmIdentifier &alg_id, const secure_vector< uint8_t > &key_bits)
Definition: pk_algs.cpp:170
std::unique_ptr< Private_Key > create_private_key(const std::string &alg_name, RandomNumberGenerator &rng, const std::string &params, const std::string &provider)
Definition: pk_algs.cpp:273
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Definition: bigint.h:796
std::unique_ptr< Public_Key > load_public_key(const AlgorithmIdentifier &alg_id, const std::vector< uint8_t > &key_bits)
Definition: pk_algs.cpp:84
Definition: alg_id.cpp:13
std::vector< std::string > probe_provider_private_key(const std::string &alg_name, const std::vector< std::string > possible)
Definition: pk_algs.cpp:414
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88