monotone

monotone Mtn Source Tree

Root/botan/rsa.h

1/*************************************************
2* RSA Header File *
3* (C) 1999-2005 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 SecureVector<byte> encrypt(const byte[], u32bit) const;
22 SecureVector<byte> verify(const byte[], u32bit) const;
23
24 RSA_PublicKey(const BigInt&, const BigInt&);
25 protected:
26 BigInt public_op(const BigInt&) const;
27 std::string algo_name() const { return "RSA"; }
28 RSA_PublicKey() {}
29 private:
30 friend X509_PublicKey* get_public_key(const std::string&);
31 };
32
33/*************************************************
34* RSA Private Key *
35*************************************************/
36class RSA_PrivateKey : public RSA_PublicKey, public PK_Decrypting_Key,
37 public PK_Signing_Key, public IF_Scheme_PrivateKey
38 {
39 public:
40 SecureVector<byte> decrypt(const byte[], u32bit) const;
41 SecureVector<byte> sign(const byte[], u32bit) const;
42
43 bool check_key(bool) const;
44
45 RSA_PrivateKey(const BigInt&, const BigInt&, const BigInt&,
46 const BigInt& = 0, const BigInt& = 0);
47 RSA_PrivateKey(u32bit, u32bit = 65537);
48 private:
49 friend PKCS8_PrivateKey* get_private_key(const std::string&);
50 BigInt private_op(const byte[], u32bit) const;
51 RSA_PrivateKey() {}
52 };
53
54}
55
56#endif

Archive Download this file

Branches

Tags

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