Botan 3.6.1
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/asn1_obj.h>
12#include <botan/pk_keys.h>
13#include <memory>
14
15namespace Botan {
16
18std::unique_ptr<Public_Key> load_public_key(const AlgorithmIdentifier& alg_id, std::span<const uint8_t> key_bits);
19
21std::unique_ptr<Private_Key> load_private_key(const AlgorithmIdentifier& alg_id, std::span<const uint8_t> key_bits);
22
23/**
24* Create a new key
25* For ECC keys, algo_params specifies EC group (eg, "secp256r1")
26* For DH/DSA/ElGamal keys, algo_params is DL group (eg, "modp/ietf/2048")
27* For RSA, algo_params is integer keylength
28* For McEliece, algo_params is n,t
29* If algo_params is left empty, suitable default parameters are chosen.
30*/
32std::unique_ptr<Private_Key> create_private_key(std::string_view algo_name,
33 RandomNumberGenerator& rng,
34 std::string_view algo_params = "",
35 std::string_view provider = "");
36
37class EC_Group;
38
39/**
40* Create a new ECC key
41*/
43std::unique_ptr<Private_Key> create_ec_private_key(std::string_view algo_name,
44 const EC_Group& group,
45 RandomNumberGenerator& rng);
46
48std::vector<std::string> probe_provider_private_key(std::string_view algo_name,
49 const std::vector<std::string>& possible);
50
51} // namespace Botan
52
53#endif
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
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:470
std::vector< std::string > probe_provider_private_key(std::string_view alg_name, const std::vector< std::string > &possible)
Definition pk_algs.cpp:695
std::unique_ptr< Private_Key > load_private_key(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
Definition pk_algs.cpp:272
std::unique_ptr< Public_Key > load_public_key(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
Definition pk_algs.cpp:119
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:425