diff options
author | lloyd <[email protected]> | 2008-11-11 20:54:18 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-11-11 20:54:18 +0000 |
commit | 8986f83af617d76e54ae40348d0a77ea1e5e51e4 (patch) | |
tree | 419cebf489bd28084615290bccd63516b4ca2696 /src/pubkey/pk_lookup | |
parent | e7e3551e44f8defc6d78be4e513ea5ee2631933b (diff) |
Remove pk_lookup - half of it (look_pk.{cpp,h}) depended on libstate directly,
the other half was relied upon by pubkey. Move the contents into those two
modules. Update deps.
Diffstat (limited to 'src/pubkey/pk_lookup')
-rw-r--r-- | src/pubkey/pk_lookup/info.txt | 18 | ||||
-rw-r--r-- | src/pubkey/pk_lookup/look_pk.cpp | 74 | ||||
-rw-r--r-- | src/pubkey/pk_lookup/look_pk.h | 76 | ||||
-rw-r--r-- | src/pubkey/pk_lookup/pk_algs.cpp | 110 | ||||
-rw-r--r-- | src/pubkey/pk_lookup/pk_algs.h | 30 |
5 files changed, 0 insertions, 308 deletions
diff --git a/src/pubkey/pk_lookup/info.txt b/src/pubkey/pk_lookup/info.txt deleted file mode 100644 index 39dd4dfc2..000000000 --- a/src/pubkey/pk_lookup/info.txt +++ /dev/null @@ -1,18 +0,0 @@ -realname "Public Key Lookup" - -define PUBLIC_KEY_LOOKUP - -load_on dep - -<requires> -asn1 -bigint -numbertheory -</requires> - -<add> -look_pk.cpp -look_pk.h -pk_algs.cpp -pk_algs.h -</add> diff --git a/src/pubkey/pk_lookup/look_pk.cpp b/src/pubkey/pk_lookup/look_pk.cpp deleted file mode 100644 index d72c1ce0f..000000000 --- a/src/pubkey/pk_lookup/look_pk.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************* -* PK Algorithm Lookup Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include <botan/look_pk.h> -#include <botan/lookup.h> - -namespace Botan { - -/************************************************* -* Get a PK_Encryptor object * -*************************************************/ -PK_Encryptor* get_pk_encryptor(const PK_Encrypting_Key& key, - const std::string& eme) - { - return new PK_Encryptor_MR_with_EME(key, get_eme(eme)); - } - -/************************************************* -* Get a PK_Decryptor object * -*************************************************/ -PK_Decryptor* get_pk_decryptor(const PK_Decrypting_Key& key, - const std::string& eme) - { - return new PK_Decryptor_MR_with_EME(key, get_eme(eme)); - } - -/************************************************* -* Get a PK_Signer object * -*************************************************/ -PK_Signer* get_pk_signer(const PK_Signing_Key& key, - const std::string& emsa, - Signature_Format sig_format) - { - PK_Signer* signer = new PK_Signer(key, get_emsa(emsa)); - signer->set_output_format(sig_format); - return signer; - } - -/************************************************* -* Get a PK_Verifier object * -*************************************************/ -PK_Verifier* get_pk_verifier(const PK_Verifying_with_MR_Key& key, - const std::string& emsa, - Signature_Format sig_format) - { - PK_Verifier* verifier = new PK_Verifier_with_MR(key, get_emsa(emsa)); - verifier->set_input_format(sig_format); - return verifier; - } - -/************************************************* -* Get a PK_Verifier object * -*************************************************/ -PK_Verifier* get_pk_verifier(const PK_Verifying_wo_MR_Key& key, - const std::string& emsa, - Signature_Format sig_format) - { - PK_Verifier* verifier = new PK_Verifier_wo_MR(key, get_emsa(emsa)); - verifier->set_input_format(sig_format); - return verifier; - } - -/************************************************* -* Get a PK_Key_Agreement object * -*************************************************/ -PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key& key, - const std::string& kdf) - { - return new PK_Key_Agreement(key, get_kdf(kdf)); - } - -} diff --git a/src/pubkey/pk_lookup/look_pk.h b/src/pubkey/pk_lookup/look_pk.h deleted file mode 100644 index 926416a41..000000000 --- a/src/pubkey/pk_lookup/look_pk.h +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************* -* PK Algorithm Lookup Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_PK_LOOKUP_H__ -#define BOTAN_PK_LOOKUP_H__ - -#include <botan/build.h> -#include <botan/pubkey.h> - -namespace Botan { - -/** -* Public key encryptor factory method. -* @param key the key that will work inside the encryptor -* @param pad determines the algorithm and encoding -* @return the public key encryptor object -*/ -BOTAN_DLL PK_Encryptor* get_pk_encryptor(const PK_Encrypting_Key& key, - const std::string& pad); - -/** -* Public key decryptor factory method. -* @param key the key that will work inside the decryptor -* @param pad determines the algorithm and encoding -* @return the public key decryptor object -*/ -BOTAN_DLL PK_Decryptor* get_pk_decryptor(const PK_Decrypting_Key& key, - const std::string& pad); - -/** -* Public key signer factory method. -* @param key the key that will work inside the signer -* @param pad determines the algorithm, encoding and hash algorithm -* @param sig_format the signature format to be used -* @return the public key signer object -*/ -BOTAN_DLL PK_Signer* get_pk_signer(const PK_Signing_Key& key, - const std::string& pad, - Signature_Format = IEEE_1363); - -/** -* Public key verifier factory method. -* @param key the key that will work inside the verifier -* @param pad determines the algorithm, encoding and hash algorithm -* @param sig_format the signature format to be used -* @return the public key verifier object -*/ -BOTAN_DLL PK_Verifier* get_pk_verifier(const PK_Verifying_with_MR_Key& key, - const std::string& pad, - Signature_Format = IEEE_1363); - -/** -* Public key verifier factory method. -* @param key the key that will work inside the verifier -* @param pad determines the algorithm, encoding and hash algorithm -* @param sig_form the signature format to be used -* @return the public key verifier object -*/ -BOTAN_DLL PK_Verifier* get_pk_verifier(const PK_Verifying_wo_MR_Key& key, - const std::string& pad, - Signature_Format sig_form = IEEE_1363); - -/** -* Public key key agreement factory method. -* @param key the key that will work inside the key agreement -* @param pad determines the algorithm, encoding and hash algorithm -* @return the public key verifier object -*/ -BOTAN_DLL PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key& key, - const std::string& pad); - -} - -#endif diff --git a/src/pubkey/pk_lookup/pk_algs.cpp b/src/pubkey/pk_lookup/pk_algs.cpp deleted file mode 100644 index 3d33d8f35..000000000 --- a/src/pubkey/pk_lookup/pk_algs.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************* -* PK Key Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#include <botan/pk_algs.h> - -#if defined(BOTAN_HAS_RSA) - #include <botan/rsa.h> -#endif - -#if defined(BOTAN_HAS_DSA) - #include <botan/dsa.h> -#endif - -#if defined(BOTAN_HAS_DIFFIE_HELLMAN) - #include <botan/dh.h> -#endif - -#if defined(BOTAN_HAS_ECDSA) - #include <botan/ecdsa.h> -#endif - -#if defined(BOTAN_HAS_NYBERG_RUEPPEL) - #include <botan/nr.h> -#endif - -#if defined(BOTAN_HAS_RW) - #include <botan/rw.h> -#endif - -#if defined(BOTAN_HAS_ELGAMAL) - #include <botan/elgamal.h> -#endif - -namespace Botan { - -/************************************************* -* Get an PK public key object * -*************************************************/ -Public_Key* get_public_key(const std::string& alg_name) - { -#if defined(BOTAN_HAS_RSA) - if(alg_name == "RSA") return new RSA_PublicKey; -#endif - -#if defined(BOTAN_HAS_DSA) - if(alg_name == "DSA") return new DSA_PublicKey; -#endif - -#if defined(BOTAN_HAS_DIFFIE_HELLMAN) - if(alg_name == "DH") return new DH_PublicKey; -#endif - -#if defined(BOTAN_HAS_NYBERG_RUEPPEL) - if(alg_name == "NR") return new NR_PublicKey; -#endif - -#if defined(BOTAN_HAS_RW) - if(alg_name == "RW") return new RW_PublicKey; -#endif - -#if defined(BOTAN_HAS_ELG) - if(alg_name == "ELG") return new ElGamal_PublicKey; -#endif - -#if defined(BOTAN_HAS_ECDSA) - if(alg_name == "ECDSA") return new ECDSA_PublicKey; -#endif - - return 0; - } - -/************************************************* -* Get an PK private key object * -*************************************************/ -Private_Key* get_private_key(const std::string& alg_name) - { -#if defined(BOTAN_HAS_RSA) - if(alg_name == "RSA") return new RSA_PrivateKey; -#endif - -#if defined(BOTAN_HAS_DSA) - if(alg_name == "DSA") return new DSA_PrivateKey; -#endif - -#if defined(BOTAN_HAS_DIFFIE_HELLMAN) - if(alg_name == "DH") return new DH_PrivateKey; -#endif - -#if defined(BOTAN_HAS_NYBERG_RUEPPEL) - if(alg_name == "NR") return new NR_PrivateKey; -#endif - -#if defined(BOTAN_HAS_RW) - if(alg_name == "RW") return new RW_PrivateKey; -#endif - -#if defined(BOTAN_HAS_ELG) - if(alg_name == "ELG") return new ElGamal_PrivateKey; -#endif - -#if defined(BOTAN_HAS_ECDSA) - if(alg_name == "ECDSA") return new ECDSA_PrivateKey; -#endif - - return 0; - } - -} diff --git a/src/pubkey/pk_lookup/pk_algs.h b/src/pubkey/pk_lookup/pk_algs.h deleted file mode 100644 index 2bb9a546e..000000000 --- a/src/pubkey/pk_lookup/pk_algs.h +++ /dev/null @@ -1,30 +0,0 @@ -/************************************************* -* PK Key Factory Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_PK_KEY_FACTORY_H__ -#define BOTAN_PK_KEY_FACTORY_H__ - -#include <botan/x509_key.h> -#include <botan/pkcs8.h> - -namespace Botan { - -/** -* Get an empty public key object. -* @param name the name of the desired public key algorithm -* @return the public key object -*/ -BOTAN_DLL Public_Key* get_public_key(const std::string&); - -/** -* Get an empty private key object. -* @param name the name of the desired public key algorithm -* @return the private key object -*/ -BOTAN_DLL Private_Key* get_private_key(const std::string&); - -} - -#endif |