3
* (C) 1999-2007 Jack Lloyd
5
* Distributed under the terms of the Botan license
8
#include <botan/pk_algs.h>
10
#if defined(BOTAN_HAS_RSA)
11
#include <botan/rsa.h>
14
#if defined(BOTAN_HAS_DSA)
15
#include <botan/dsa.h>
18
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
22
#if defined(BOTAN_HAS_ECDSA)
23
#include <botan/ecdsa.h>
26
#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
30
#if defined(BOTAN_HAS_RW)
34
#if defined(BOTAN_HAS_ELGAMAL)
35
#include <botan/elgamal.h>
41
* Get an PK public key object
43
Public_Key* get_public_key(const std::string& alg_name)
45
#if defined(BOTAN_HAS_RSA)
46
if(alg_name == "RSA") return new RSA_PublicKey;
49
#if defined(BOTAN_HAS_DSA)
50
if(alg_name == "DSA") return new DSA_PublicKey;
53
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
54
if(alg_name == "DH") return new DH_PublicKey;
57
#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
58
if(alg_name == "NR") return new NR_PublicKey;
61
#if defined(BOTAN_HAS_RW)
62
if(alg_name == "RW") return new RW_PublicKey;
65
#if defined(BOTAN_HAS_ELG)
66
if(alg_name == "ELG") return new ElGamal_PublicKey;
69
#if defined(BOTAN_HAS_ECDSA)
70
if(alg_name == "ECDSA") return new ECDSA_PublicKey;
77
* Get an PK private key object
79
Private_Key* get_private_key(const std::string& alg_name)
81
#if defined(BOTAN_HAS_RSA)
82
if(alg_name == "RSA") return new RSA_PrivateKey;
85
#if defined(BOTAN_HAS_DSA)
86
if(alg_name == "DSA") return new DSA_PrivateKey;
89
#if defined(BOTAN_HAS_DIFFIE_HELLMAN)
90
if(alg_name == "DH") return new DH_PrivateKey;
93
#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
94
if(alg_name == "NR") return new NR_PrivateKey;
97
#if defined(BOTAN_HAS_RW)
98
if(alg_name == "RW") return new RW_PrivateKey;
101
#if defined(BOTAN_HAS_ELG)
102
if(alg_name == "ELG") return new ElGamal_PrivateKey;
105
#if defined(BOTAN_HAS_ECDSA)
106
if(alg_name == "ECDSA") return new ECDSA_PrivateKey;