Class cryptiX.rsa.PrivateKey
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptiX.rsa.PrivateKey

java.lang.Object
   |
   +----java.util.Observable
           |
           +----cryptiX.rsa.PublicKey
                   |
                   +----cryptiX.rsa.PrivateKey

public class PrivateKey
extends PublicKey
implements Observer
Class for handling private keys

Constructor Index

 o PrivateKey()
The default constructor.

Method Index

 o coefficient()
returns the coefficient
 o createSignature(byte[], String)
creates a signature according to PKCS #1
 o cryptPrivate(BigInt)
Encrypt or decrypt a BigInt using the private key.
 o exponent1()
returns the first exponent
 o exponent2()
returns the second exponent
 o generateKeys(int)
generates the key pair and uses the Java default random number generator
 o generateKeys(int, Random)
generates the key pair and uses a give random number generator
 o prime1()
returns the first prime
 o prime2()
returns the second prime
 o privateExponent()
returns the private exponent
 o publicKey()
returns the public key part of this private key
 o toString()
String representation of the public key
 o update(Observable, Object)

Constructors

 o PrivateKey
  public PrivateKey()
The default constructor.

Methods

 o cryptPrivate
  public BigInt cryptPrivate(BigInt message)
Encrypt or decrypt a BigInt using the private key. Simply performs a modula exponentiation.
Parameters:
message - the BigInt to de/encrypt
 o update
  public void update(Observable o,
                     Object arg)
 o generateKeys
  public void generateKeys(int keylen)
generates the key pair and uses the Java default random number generator
Parameters:
keylen - number of bits for modulus
 o generateKeys
  public void generateKeys(int keylen,
                           Random rg)
generates the key pair and uses a give random number generator
Parameters:
keylen - number of bits for modulus
rg - the random number generator to use
 o publicKey
  public PublicKey publicKey()
returns the public key part of this private key
 o createSignature
  public byte[] createSignature(byte message[],
                                String signatureAlgorithm) throws CodingException
creates a signature according to PKCS #1
 o privateExponent
  public BigInt privateExponent()
returns the private exponent
 o prime1
  public BigInt prime1()
returns the first prime
 o prime2
  public BigInt prime2()
returns the second prime
 o exponent1
  public BigInt exponent1()
returns the first exponent
 o exponent2
  public BigInt exponent2()
returns the second exponent
 o coefficient
  public BigInt coefficient()
returns the coefficient
 o toString
  public String toString()
String representation of the public key
Overrides:
toString in class PublicKey

All Packages  Class Hierarchy  This Package  Previous  Next  Index