monotone

monotone Mtn Source Tree

Root/botan/if_algo.h

1/*************************************************
2* IF Scheme Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_IF_ALGO_H__
7#define BOTAN_IF_ALGO_H__
8
9#include <botan/x509_key.h>
10#include <botan/pkcs8.h>
11#include <botan/pk_core.h>
12
13namespace Botan {
14
15/*************************************************
16* IF Public Key *
17*************************************************/
18class IF_Scheme_PublicKey : public virtual X509_PublicKey
19 {
20 public:
21 bool check_key(bool) const;
22
23 const BigInt& get_n() const { return n; }
24 const BigInt& get_e() const { return e; }
25
26 u32bit max_input_bits() const { return (n.bits() - 1); }
27
28 virtual ~IF_Scheme_PublicKey() {}
29 protected:
30 virtual void X509_load_hook();
31 BigInt n, e;
32 IF_Core core;
33 private:
34 MemoryVector<byte> DER_encode_pub() const;
35 MemoryVector<byte> DER_encode_params() const;
36 void BER_decode_params(DataSource&);
37 void BER_decode_pub(DataSource&);
38 };
39
40/*************************************************
41* IF Private Key *
42*************************************************/
43class IF_Scheme_PrivateKey : public virtual IF_Scheme_PublicKey,
44 public virtual PKCS8_PrivateKey
45 {
46 public:
47 bool check_key(bool) const;
48
49 const BigInt& get_p() const { return p; }
50 const BigInt& get_q() const { return q; }
51 const BigInt& get_d() const { return d; }
52
53 virtual ~IF_Scheme_PrivateKey() {}
54 protected:
55 virtual void PKCS8_load_hook();
56 BigInt d, p, q, d1, d2, c;
57 private:
58 SecureVector<byte> DER_encode_priv() const;
59 void BER_decode_priv(DataSource&);
60 };
61
62}
63
64#endif

Archive Download this file

Branches

Tags

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