cryptix.security.rsa
Class SecretKey

java.lang.Object
  |
  +--cryptix.security.rsa.PublicKey
        |
        +--cryptix.security.rsa.SecretKey

Deprecated. This class may be removed in a future version of Cryptix.

public class SecretKey
extends PublicKey

This class represents an RSA secret key pair. It can also be used as a public key.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.4 $

Since:
Cryptix 2.2
Author:
Systemics Ltd, David Hopwood
See Also:
cryptix.provider.rsa.BaseRSAPrivateKey

Field Summary
protected  BigInteger d_
          Deprecated. the private exponent
protected  BigInteger p_
          Deprecated. one of the factors of n
protected  BigInteger q_
          Deprecated. the other factor of n
protected  BigInteger u_
          Deprecated. the multiplicative inverse of p mod q
 
Fields inherited from class cryptix.security.rsa.PublicKey
e_, n_
 
Constructor Summary
protected SecretKey()
          Deprecated. A constructor that does no initialization, for use only by subclasses.
  SecretKey(BigInteger n, BigInteger e, BigInteger d, BigInteger p, BigInteger q, BigInteger u)
          Deprecated. Constructs a secret key pair from the component parts.
 
Method Summary
 BigInteger cryptFast(BigInteger exponent, BigInteger input)
          Deprecated. Performs a fast encryption/decryption, using the Chinese Remainder Theorem.
 BigInteger d()
          Deprecated. Returns the private exponent, d.
 BigInteger decrypt(BigInteger encrypted)
          Deprecated. Decrypts a number.
 BigInteger encrypt(BigInteger plain)
          Deprecated. Encrypts a number.
 java.lang.String insane()
          Deprecated. Performs a sanity check on the key.
 BigInteger p()
          Deprecated. Returns the smaller factor of n, p.
 BigInteger q()
          Deprecated. Returns the larger factor of n, q.
 java.lang.String test()
          Deprecated. Performs a basic test on the key.
 java.lang.String toString()
          Deprecated. Returns a string representation of all parts of the secret key.
 BigInteger u()
          Deprecated. Returns the multiplicative inverse of p mod q.
 
Methods inherited from class cryptix.security.rsa.PublicKey
bitLength, copy, e, equals, fingerPrint, id, n
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

d_

protected BigInteger d_
Deprecated. 
the private exponent

p_

protected BigInteger p_
Deprecated. 
one of the factors of n

q_

protected BigInteger q_
Deprecated. 
the other factor of n

u_

protected BigInteger u_
Deprecated. 
the multiplicative inverse of p mod q
Constructor Detail

SecretKey

protected SecretKey()
Deprecated. 
A constructor that does no initialization, for use only by subclasses.

SecretKey

public SecretKey(BigInteger n,
                 BigInteger e,
                 BigInteger d,
                 BigInteger p,
                 BigInteger q,
                 BigInteger u)
Deprecated. 
Constructs a secret key pair from the component parts.
Parameters:
n - the public modulus
e - the public (encryption) exponent
d - the private (decryption) exponent
p - the smaller factor of n
q - the larger factor of n
u - the multiplicative inverse of p mod q
Method Detail

d

public final BigInteger d()
Deprecated. 
Returns the private exponent, d.

p

public final BigInteger p()
Deprecated. 
Returns the smaller factor of n, p.

q

public final BigInteger q()
Deprecated. 
Returns the larger factor of n, q.

u

public final BigInteger u()
Deprecated. 
Returns the multiplicative inverse of p mod q.

decrypt

public BigInteger decrypt(BigInteger encrypted)
Deprecated. 
Decrypts a number. This is used for decryption or signing.
Parameters:
encrypted - the number to decrypt.
Returns:
a decrypted number.

encrypt

public BigInteger encrypt(BigInteger plain)
Deprecated. 
Encrypts a number. This is used for encryption or signature verification. N.B. this is quicker than the public key method, since secret components are available.
Overrides:
encrypt in class PublicKey
Parameters:
plain - the number to encrypt.
Returns:
an encrypted number.

cryptFast

public final BigInteger cryptFast(BigInteger exponent,
                                  BigInteger input)
Deprecated. 
Performs a fast encryption/decryption, using the Chinese Remainder Theorem.
Parameters:
exponent - either e if encrypting or d if decrypting.
input - the value to encrypt or decrypt.
Returns:
the result of the operation.

insane

public final java.lang.String insane()
Deprecated. 
Performs a sanity check on the key.
Returns:
null if the key is O.K., otherwise an error message.

test

public final java.lang.String test()
Deprecated. 
Performs a basic test on the key.
Returns:
null if the key is O.K., otherwise an error message.

toString

public java.lang.String toString()
Deprecated. 
Returns a string representation of all parts of the secret key. This method should be used with caution, in order that the secret key is not compromised.
Overrides:
toString in class PublicKey
Returns:
a string representation of the key.