Quadcap Embeddable Database

com.quadcap.crypto.RSAPrivateKey Class Reference

Inheritance diagram for com.quadcap.crypto.RSAPrivateKey:

com.quadcap.crypto.RSAKey com.quadcap.crypto.PrivateKey com.quadcap.crypto.Key com.quadcap.crypto.Key List of all members.

Detailed Description

RSA Private Key implementation.

Author:
Stan Bailes

Definition at line 52 of file RSAPrivateKey.java.

Public Member Functions

 RSAPrivateKey ()
 Default constructor.

void init (String s)
 Initialize from string representation.

String toString ()
 Return the string representation.

void init (String text, int siz, Random random)
 Create a new keypair.

void f (ByteBuffer cipher, ByteBuffer plain)
 Decrypt a buffer (in chunks).

PublicKey getPublicKey ()
 Return the public portion of the key.


Protected Member Functions

final BigInteger engine (BigInteger c)
 The derived class (public/private) implements this as appropriate.


Private Member Functions

final void init ()
final BigInteger makePrime (int size, Random random)

Private Attributes

final BigInteger ZERO = BigInteger.ZERO
final BigInteger ONE = BigInteger.ONE
final BigInteger TWO = new BigInteger("2")
final BigInteger THREE = new BigInteger("3")
BigInteger p
BigInteger q
BigInteger d
BigInteger dP
BigInteger dQ
BigInteger qInv


Constructor & Destructor Documentation

com.quadcap.crypto.RSAPrivateKey.RSAPrivateKey  ) 
 

Default constructor.

Definition at line 69 of file RSAPrivateKey.java.


Member Function Documentation

final BigInteger com.quadcap.crypto.RSAPrivateKey.engine BigInteger  c  )  [protected, virtual]
 

The derived class (public/private) implements this as appropriate.

Implements com.quadcap.crypto.RSAKey.

Definition at line 144 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.d, com.quadcap.crypto.RSAPrivateKey.dP, com.quadcap.crypto.RSAPrivateKey.dQ, com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.p, com.quadcap.crypto.RSAPrivateKey.q, and com.quadcap.crypto.RSAPrivateKey.qInv.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), and com.quadcap.crypto.RSAPrivateKey.f().

void com.quadcap.crypto.RSAPrivateKey.f ByteBuffer  cipher,
ByteBuffer  plain
 

Decrypt a buffer (in chunks).

Implements com.quadcap.crypto.PrivateKey.

Definition at line 111 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.engine(), and com.quadcap.crypto.RSAPrivateKey.f().

Referenced by com.quadcap.crypto.RSAPrivateKey.f().

PublicKey com.quadcap.crypto.RSAPrivateKey.getPublicKey  ) 
 

Return the public portion of the key.

Implements com.quadcap.crypto.PrivateKey.

Definition at line 118 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPublicKey.init().

final void com.quadcap.crypto.RSAPrivateKey.init  )  [private]
 

Definition at line 124 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.d, com.quadcap.crypto.RSAPrivateKey.dP, com.quadcap.crypto.RSAPrivateKey.dQ, com.quadcap.crypto.RSAPrivateKey.p, com.quadcap.crypto.RSAPrivateKey.q, and com.quadcap.crypto.RSAPrivateKey.qInv.

Referenced by com.quadcap.crypto.RSAPrivateKey.init().

void com.quadcap.crypto.RSAPrivateKey.init String  text,
int  siz,
Random  random
 

Create a new keypair.

Implements com.quadcap.crypto.PrivateKey.

Definition at line 93 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.init(), com.quadcap.crypto.RSAPrivateKey.makePrime(), com.quadcap.crypto.RSAPrivateKey.p, and com.quadcap.crypto.RSAPrivateKey.q.

void com.quadcap.crypto.RSAPrivateKey.init String  s  ) 
 

Initialize from string representation.

Implements com.quadcap.crypto.PrivateKey.

Definition at line 74 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.init(), com.quadcap.crypto.RSAPrivateKey.p, and com.quadcap.crypto.RSAPrivateKey.q.

Referenced by com.quadcap.crypto.KeyFactory.createPrivateKey(), and com.quadcap.crypto.KeyFactory.readPrivateKey().

final BigInteger com.quadcap.crypto.RSAPrivateKey.makePrime int  size,
Random  random
[private]
 

Definition at line 136 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.makePrime(), com.quadcap.crypto.RSAPrivateKey.ONE, com.quadcap.crypto.RSAPrivateKey.THREE, and com.quadcap.crypto.RSAPrivateKey.ZERO.

Referenced by com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.makePrime().

String com.quadcap.crypto.RSAPrivateKey.toString  ) 
 

Return the string representation.

Implements com.quadcap.crypto.PrivateKey.

Definition at line 85 of file RSAPrivateKey.java.

References com.quadcap.crypto.RSAPrivateKey.dP, com.quadcap.crypto.RSAPrivateKey.dQ, com.quadcap.crypto.RSAPrivateKey.p, com.quadcap.crypto.RSAPrivateKey.q, and com.quadcap.crypto.RSAPrivateKey.qInv.


Member Data Documentation

BigInteger com.quadcap.crypto.RSAPrivateKey.d [private]
 

Definition at line 61 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), and com.quadcap.crypto.RSAPrivateKey.init().

BigInteger com.quadcap.crypto.RSAPrivateKey.dP [private]
 

Definition at line 62 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.toString().

BigInteger com.quadcap.crypto.RSAPrivateKey.dQ [private]
 

Definition at line 63 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.toString().

final BigInteger com.quadcap.crypto.RSAPrivateKey.ONE = BigInteger.ONE [private]
 

Definition at line 54 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.makePrime().

BigInteger com.quadcap.crypto.RSAPrivateKey.p [private]
 

Definition at line 58 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.toString().

BigInteger com.quadcap.crypto.RSAPrivateKey.q [private]
 

Definition at line 59 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.toString().

BigInteger com.quadcap.crypto.RSAPrivateKey.qInv [private]
 

Definition at line 64 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.engine(), com.quadcap.crypto.RSAPrivateKey.init(), and com.quadcap.crypto.RSAPrivateKey.toString().

final BigInteger com.quadcap.crypto.RSAPrivateKey.THREE = new BigInteger("3") [private]
 

Definition at line 56 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.makePrime().

final BigInteger com.quadcap.crypto.RSAPrivateKey.TWO = new BigInteger("2") [private]
 

Definition at line 55 of file RSAPrivateKey.java.

final BigInteger com.quadcap.crypto.RSAPrivateKey.ZERO = BigInteger.ZERO [private]
 

Definition at line 53 of file RSAPrivateKey.java.

Referenced by com.quadcap.crypto.RSAPrivateKey.makePrime().