Botan  2.1.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_DLL std::unique_ptr<Public_Key>
18 load_public_key(const AlgorithmIdentifier& alg_id,
19  const std::vector<uint8_t>& key_bits);
20 
21 BOTAN_DLL 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_DLL std::unique_ptr<Private_Key>
34 create_private_key(const std::string& algo_name,
35  RandomNumberGenerator& rng,
36  const std::string& algo_params = "");
37 
38 }
39 
40 #endif
std::unique_ptr< Public_Key > load_public_key(const AlgorithmIdentifier &alg_id, const std::vector< uint8_t > &key_bits)
Definition: pk_algs.cpp:62
Definition: alg_id.cpp:13
std::unique_ptr< Private_Key > load_private_key(const AlgorithmIdentifier &alg_id, const secure_vector< uint8_t > &key_bits)
Definition: pk_algs.cpp:133
std::unique_ptr< Private_Key > create_private_key(const std::string &alg_name, RandomNumberGenerator &rng, const std::string &params)
Definition: pk_algs.cpp:204