monotone

monotone Mtn Source Tree

Root/botan/rsa.h

1/*************************************************
2* RSA Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_RSA_H__
7#define BOTAN_RSA_H__
8
9#include <botan/if_algo.h>
10
11namespace Botan {
12
13/*************************************************
14* RSA Public Key *
15*************************************************/
16class RSA_PublicKey : public PK_Encrypting_Key,
17 public PK_Verifying_with_MR_Key,
18 public virtual IF_Scheme_PublicKey
19 {
20 public:
21 std::string algo_name() const { return "RSA"; }
22
23 SecureVector<byte> encrypt(const byte[], u32bit) const;
24 SecureVector<byte> verify(const byte[], u32bit) const;
25
26 RSA_PublicKey() {}
27 RSA_PublicKey(const BigInt&, const BigInt&);
28 protected:
29 BigInt public_op(const BigInt&) const;
30 };
31
32/*************************************************
33* RSA Private Key *
34*************************************************/
35class RSA_PrivateKey : public RSA_PublicKey,
36 public PK_Decrypting_Key,
37 public PK_Signing_Key,
38 public IF_Scheme_PrivateKey
39 {
40 public:
41 SecureVector<byte> decrypt(const byte[], u32bit) const;
42 SecureVector<byte> sign(const byte[], u32bit) const;
43
44 bool check_key(bool) const;
45
46 RSA_PrivateKey() {}
47 RSA_PrivateKey(const BigInt&, const BigInt&, const BigInt&,
48 const BigInt& = 0, const BigInt& = 0);
49 RSA_PrivateKey(u32bit, u32bit = 65537);
50 private:
51 BigInt private_op(const byte[], u32bit) const;
52 };
53
54}
55
56#endif

Archive Download this file

Branches

Tags

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