monotone

monotone Mtn Source Tree

Root/botan/look_pk.cpp

1/*************************************************
2* PK Algorithm Lookup Source File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#include <botan/look_pk.h>
7#include <botan/lookup.h>
8
9namespace Botan {
10
11/*************************************************
12* Get a PK_Encryptor object *
13*************************************************/
14PK_Encryptor* get_pk_encryptor(const PK_Encrypting_Key& key,
15 const std::string& eme)
16 {
17 return new PK_Encryptor_MR_with_EME(key, eme);
18 }
19
20/*************************************************
21* Get a PK_Decryptor object *
22*************************************************/
23PK_Decryptor* get_pk_decryptor(const PK_Decrypting_Key& key,
24 const std::string& eme)
25 {
26 return new PK_Decryptor_MR_with_EME(key, eme);
27 }
28
29/*************************************************
30* Get a PK_Signer object *
31*************************************************/
32PK_Signer* get_pk_signer(const PK_Signing_Key& key,
33 const std::string& encoding,
34 Signature_Format sig_format)
35 {
36 PK_Signer* signer = new PK_Signer(key, encoding);
37 signer->set_output_format(sig_format);
38 return signer;
39 }
40
41/*************************************************
42* Get a PK_Verifier object *
43*************************************************/
44PK_Verifier* get_pk_verifier(const PK_Verifying_with_MR_Key& key,
45 const std::string& encoding,
46 Signature_Format sig_format)
47 {
48 PK_Verifier* verifier = new PK_Verifier_with_MR(key, encoding);
49 verifier->set_input_format(sig_format);
50 return verifier;
51 }
52
53/*************************************************
54* Get a PK_Verifier object *
55*************************************************/
56PK_Verifier* get_pk_verifier(const PK_Verifying_wo_MR_Key& key,
57 const std::string& encoding,
58 Signature_Format sig_format)
59 {
60 PK_Verifier* verifier = new PK_Verifier_wo_MR(key, encoding);
61 verifier->set_input_format(sig_format);
62 return verifier;
63 }
64
65/*************************************************
66* Get a PK_Key_Agreement object *
67*************************************************/
68PK_Key_Agreement* get_pk_kas(const PK_Key_Agreement_Key& key,
69 const std::string& kdf)
70 {
71 return new PK_Key_Agreement(key, kdf);
72 }
73
74}

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status