Botan  1.10.9
look_pk.h
Go to the documentation of this file.
1 /*
2 * PK Algorithm Lookup
3 * (C) 1999-2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_PK_LOOKUP_H__
9 #define BOTAN_PK_LOOKUP_H__
10 
11 #include <botan/lookup.h>
12 #include <botan/pubkey.h>
13 
14 namespace Botan {
15 
16 /**
17 * Public key encryptor factory method.
18 * @deprecated Instantiate object from pubkey.h directly
19 *
20 * @param key the key that will work inside the encryptor
21 * @param eme determines the algorithm and encoding
22 * @return public key encryptor object
23 */
24 BOTAN_DEPRECATED("Instantiate object directly")
26  const std::string& eme)
27  {
28  return new PK_Encryptor_EME(key, eme);
29  }
30 
31 /**
32 * Public key decryptor factory method.
33 * @deprecated Instantiate object from pubkey.h directly
34 *
35 * @param key the key that will work inside the decryptor
36 * @param eme determines the algorithm and encoding
37 * @return public key decryptor object
38 */
39 BOTAN_DEPRECATED("Instantiate object directly")
41  const std::string& eme)
42  {
43  return new PK_Decryptor_EME(key, eme);
44  }
45 
46 /**
47 * Public key signer factory method.
48 * @deprecated Instantiate object from pubkey.h directly
49 *
50 * @param key the key that will work inside the signer
51 * @param emsa determines the algorithm, encoding and hash algorithm
52 * @param sig_format the signature format to be used
53 * @return public key signer object
54 */
55 BOTAN_DEPRECATED("Instantiate object directly")
56 inline PK_Signer* get_pk_signer(const Private_Key& key,
57  const std::string& emsa,
58  Signature_Format sig_format = IEEE_1363)
59  {
60  return new PK_Signer(key, emsa, sig_format);
61  }
62 
63 /**
64 * Public key verifier factory method.
65 * @deprecated Instantiate object from pubkey.h directly
66 *
67 * @param key the key that will work inside the verifier
68 * @param emsa determines the algorithm, encoding and hash algorithm
69 * @param sig_format the signature format to be used
70 * @return public key verifier object
71 */
72 BOTAN_DEPRECATED("Instantiate object directly")
74  const std::string& emsa,
75  Signature_Format sig_format = IEEE_1363)
76  {
77  return new PK_Verifier(key, emsa, sig_format);
78  }
79 
80 /**
81 * Public key key agreement factory method.
82 * @deprecated Instantiate object from pubkey.h directly
83 *
84 * @param key the key that will work inside the key agreement
85 * @param kdf the kdf algorithm to use
86 * @return key agreement algorithm
87 */
88 BOTAN_DEPRECATED("Instantiate object directly")
90  const std::string& kdf)
91  {
92  return new PK_Key_Agreement(key, kdf);
93  }
94 
95 }
96 
97 #endif
PK_Encryptor * get_pk_encryptor(const Public_Key &key, const std::string &eme)
Definition: look_pk.h:25
Signature_Format
Definition: pubkey.h:24
Definition: secmem.h:422
PK_Verifier * get_pk_verifier(const Public_Key &key, const std::string &emsa, Signature_Format sig_format=IEEE_1363)
Definition: look_pk.h:73
PK_Decryptor * get_pk_decryptor(const Private_Key &key, const std::string &eme)
Definition: look_pk.h:40
PK_Key_Agreement * get_pk_kas(const PK_Key_Agreement_Key &key, const std::string &kdf)
Definition: look_pk.h:89
PK_Signer * get_pk_signer(const Private_Key &key, const std::string &emsa, Signature_Format sig_format=IEEE_1363)
Definition: look_pk.h:56