~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to include/dl_algo.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*************************************************
2
 
* DL Scheme Header File                          *
3
 
* (C) 1999-2007 The Botan Project                *
4
 
*************************************************/
5
 
 
6
 
#ifndef BOTAN_DL_ALGO_H__
7
 
#define BOTAN_DL_ALGO_H__
8
 
 
9
 
#include <botan/dl_group.h>
10
 
#include <botan/x509_key.h>
11
 
#include <botan/pkcs8.h>
12
 
 
13
 
namespace Botan {
14
 
 
15
 
/*************************************************
16
 
* DL Public Key                                  *
17
 
*************************************************/
18
 
class DL_Scheme_PublicKey : public virtual Public_Key
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
 
      const BigInt& group_p() const { return group.get_p(); }
26
 
      const BigInt& group_q() const { return group.get_q(); }
27
 
      const BigInt& group_g() const { return group.get_g(); }
28
 
      virtual DL_Group::Format group_format() const = 0;
29
 
 
30
 
      X509_Encoder* x509_encoder() const;
31
 
      X509_Decoder* x509_decoder();
32
 
   protected:
33
 
      BigInt y;
34
 
      DL_Group group;
35
 
   private:
36
 
      virtual void X509_load_hook() {}
37
 
   };
38
 
 
39
 
/*************************************************
40
 
* DL Private Key                                 *
41
 
*************************************************/
42
 
class DL_Scheme_PrivateKey : public virtual DL_Scheme_PublicKey,
43
 
                             public virtual Private_Key
44
 
   {
45
 
   public:
46
 
      bool check_key(bool) const;
47
 
 
48
 
      const BigInt& get_x() const { return x; }
49
 
 
50
 
      PKCS8_Encoder* pkcs8_encoder() const;
51
 
      PKCS8_Decoder* pkcs8_decoder();
52
 
   protected:
53
 
      BigInt x;
54
 
   private:
55
 
      virtual void PKCS8_load_hook(bool = false) {}
56
 
   };
57
 
 
58
 
}
59
 
 
60
 
#endif