monotone

monotone Mtn Source Tree

Root/botan/dl_algo.h

1/*************************************************
2* DL Scheme Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_DL_ALGO_H__
7#define BOTAN_DL_ALGO_H__
8
9#include <botan/dl_param.h>
10#include <botan/x509_key.h>
11#include <botan/pkcs8.h>
12
13namespace Botan {
14
15/*************************************************
16* DL Public Key *
17*************************************************/
18class DL_Scheme_PublicKey : public virtual X509_PublicKey
19 {
20 public:
21 bool check_key(bool) const;
22
23 const DL_Group& get_domain() const { return group; }
24 const BigInt& get_y() const { return y; }
25
26 virtual ~DL_Scheme_PublicKey() {}
27 protected:
28 const BigInt& group_p() const { return group.get_p(); }
29 const BigInt& group_q() const { return group.get_q(); }
30 const BigInt& group_g() const { return group.get_g(); }
31
32 BigInt y;
33 DL_Group group;
34 private:
35 MemoryVector<byte> DER_encode_pub() const;
36 MemoryVector<byte> DER_encode_params() const;
37 void BER_decode_pub(DataSource&);
38 void BER_decode_params(DataSource&);
39
40 virtual DL_Group::Format group_format() const = 0;
41 virtual void X509_load_hook() {}
42 };
43
44/*************************************************
45* DL Private Key *
46*************************************************/
47class DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey,
48 public virtual PKCS8_PrivateKey
49 {
50 public:
51 bool check_key(bool) const;
52
53 const BigInt& get_x() const { return x; }
54
55 virtual ~DL_Scheme_PrivateKey() {}
56 protected:
57 BigInt x;
58 private:
59 SecureVector<byte> DER_encode_priv() const;
60 void BER_decode_priv(DataSource&);
61
62 virtual void PKCS8_load_hook() {}
63 };
64
65}
66
67#endif

Archive Download this file

Branches

Tags

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