Botan 3.11.0
Crypto and TLS for C&
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/types.h>
12#include <memory>
13#include <span>
14#include <string>
15#include <string_view>
16#include <vector>
17
18namespace Botan {
19
20class Public_Key;
21class Private_Key;
23class EC_Group;
25
27std::unique_ptr<Public_Key> load_public_key(const AlgorithmIdentifier& alg_id, std::span<const uint8_t> key_bits);
28
30std::unique_ptr<Private_Key> load_private_key(const AlgorithmIdentifier& alg_id, std::span<const uint8_t> key_bits);
31
32/**
33* Create a new key
34* For ECC keys, algo_params specifies EC group (eg, "secp256r1")
35* For DH/DSA/ElGamal keys, algo_params is DL group (eg, "modp/ietf/2048")
36* For RSA, algo_params is integer keylength
37* For McEliece, algo_params is n,t
38* If algo_params is left empty, suitable default parameters are chosen.
39*/
41std::unique_ptr<Private_Key> create_private_key(std::string_view algo_name,
43 std::string_view algo_params = "",
44 std::string_view provider = "");
45
46/**
47* Create a new ECC key
48*/
50std::unique_ptr<Private_Key> create_ec_private_key(std::string_view algo_name,
51 const EC_Group& group,
53
55std::vector<std::string> probe_provider_private_key(std::string_view algo_name,
56 const std::vector<std::string>& possible);
57
58} // namespace Botan
59
60#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition api.h:21
std::unique_ptr< Private_Key > create_private_key(std::string_view alg_name, RandomNumberGenerator &rng, std::string_view params, std::string_view provider)
Definition pk_algs.cpp:493
std::vector< std::string > probe_provider_private_key(std::string_view alg_name, const std::vector< std::string > &possible)
Definition pk_algs.cpp:736
std::unique_ptr< Private_Key > load_private_key(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
Definition pk_algs.cpp:289
std::unique_ptr< Public_Key > load_public_key(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
Definition pk_algs.cpp:130
std::unique_ptr< Private_Key > create_ec_private_key(std::string_view alg_name, const EC_Group &ec_group, RandomNumberGenerator &rng)
Definition pk_algs.cpp:448