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
-
PrivateKey()
- The default constructor.
-
coefficient()
- returns the coefficient
-
createSignature(byte[], String)
- creates a signature according to PKCS #1
-
cryptPrivate(BigInt)
- Encrypt or decrypt a BigInt using the private key.
-
exponent1()
- returns the first exponent
-
exponent2()
- returns the second exponent
-
generateKeys(int)
- generates the key pair and uses the Java default random number generator
-
generateKeys(int, Random)
- generates the key pair and uses a give random number generator
-
prime1()
- returns the first prime
-
prime2()
- returns the second prime
-
privateExponent()
- returns the private exponent
-
publicKey()
- returns the public key part of this private key
-
toString()
- String representation of the public key
-
update(Observable, Object)
-
PrivateKey
public PrivateKey()
- The default constructor.
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
update
public void update(Observable o,
Object arg)
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
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
publicKey
public PublicKey publicKey()
- returns the public key part of this private key
createSignature
public byte[] createSignature(byte message[],
String signatureAlgorithm) throws CodingException
- creates a signature according to PKCS #1
privateExponent
public BigInt privateExponent()
- returns the private exponent
prime1
public BigInt prime1()
- returns the first prime
prime2
public BigInt prime2()
- returns the second prime
exponent1
public BigInt exponent1()
- returns the first exponent
exponent2
public BigInt exponent2()
- returns the second exponent
coefficient
public BigInt coefficient()
- returns the coefficient
toString
public String toString()
- String representation of the public key
- Overrides:
- toString in class PublicKey
All Packages Class Hierarchy This Package Previous Next Index