monotone

monotone Mtn Source Tree

Root/botan/dh.h

1/*************************************************
2* Diffie-Hellman Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_DIFFIE_HELLMAN_H__
7#define BOTAN_DIFFIE_HELLMAN_H__
8
9#include <botan/dl_algo.h>
10#include <botan/pk_core.h>
11
12namespace Botan {
13
14/*************************************************
15* Diffie-Hellman Public Key *
16*************************************************/
17class DH_PublicKey : public virtual DL_Scheme_PublicKey
18 {
19 public:
20 MemoryVector<byte> public_value() const;
21 DH_PublicKey(const DL_Group&, const BigInt&);
22 protected:
23 std::string algo_name() const { return "DH"; }
24 DH_PublicKey() {}
25 private:
26 friend X509_PublicKey* get_public_key(const std::string&);
27 DL_Group::Format group_format() const { return DL_Group::ANSI_X9_42; }
28 void X509_load_hook();
29 };
30
31/*************************************************
32* Diffie-Hellman Private Key *
33*************************************************/
34class DH_PrivateKey : public DH_PublicKey,
35 public PK_Key_Agreement_Key,
36 public virtual DL_Scheme_PrivateKey
37 {
38 public:
39 SecureVector<byte> derive_key(const byte[], u32bit) const;
40 SecureVector<byte> derive_key(const DH_PublicKey&) const;
41 SecureVector<byte> derive_key(const BigInt&) const;
42
43 MemoryVector<byte> public_value() const;
44
45 DH_PrivateKey(const DL_Group&);
46 DH_PrivateKey(const DL_Group&, const BigInt&, const BigInt& = 0);
47 private:
48 friend PKCS8_PrivateKey* get_private_key(const std::string&);
49 void PKCS8_load_hook();
50 DH_PrivateKey() {}
51
52 DH_Core core;
53 };
54
55}
56
57#endif

Archive Download this file

Branches

Tags

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