gnu.crypto.key.rsa

Class GnuRSAPrivateKey

Implemented Interfaces:
Key, PrivateKey, RSAKey, RSAPrivateCrtKey

public class GnuRSAPrivateKey
extends GnuRSAKey
implements PrivateKey, RSAPrivateCrtKey

An object that embodies an RSA private key.

References:

  1. RSA-PSS Signature Scheme with Appendix, part B.
    Primitive specification and supporting documentation.
    Jakob Jonsson and Burt Kaliski.

Version:
$Revision: 1.2 $

Constructor Summary

GnuRSAPrivateKey(BigInteger p, BigInteger q, BigInteger e, BigInteger d)
Trivial constructor.

Method Summary

boolean
equals(Object obj)
Returns true if the designated object is an instance of this class and has the same RSA parameter values as this one.
BigInteger
getCrtCoefficient()
byte[]
getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
BigInteger
getPrimeExponentP()
BigInteger
getPrimeExponentQ()
BigInteger
getPrimeP()
BigInteger
getPrimeQ()
BigInteger
getPrivateExponent()
static GnuRSAPrivateKey
valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() method of an RSA keypair codec object (an instance implementing IKeyPairCodec for RSA keys, and re-constructs an instance of this object.

Methods inherited from class gnu.crypto.key.rsa.GnuRSAKey

equals, getAlgorithm, getE, getEncoded, getEncoded, getFormat, getModulus, getN, getPublicExponent

Constructor Details

GnuRSAPrivateKey

public GnuRSAPrivateKey(BigInteger p,
                        BigInteger q,
                        BigInteger e,
                        BigInteger d)
Trivial constructor.

Parameters:
p - the modulus first prime divisor.
q - the modulus second prime divisor.
e - the public exponent.
d - the private exponent.

Method Details

equals

public boolean equals(Object obj)
Returns true if the designated object is an instance of this class and has the same RSA parameter values as this one.
Overrides:
equals in interface GnuRSAKey

Parameters:
obj - the other non-null RSA key to compare to.

Returns:
true if the designated object is of the same type and value as this one.


getCrtCoefficient

public BigInteger getCrtCoefficient()


getEncoded

public byte[] getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
Overrides:
getEncoded in interface GnuRSAKey

Parameters:
format - the desired format identifier of the resulting encoding.

Returns:
the byte sequence encoding this key according to the designated format.

See Also:
RSAKeyPairRawCodec


getPrimeExponentP

public BigInteger getPrimeExponentP()


getPrimeExponentQ

public BigInteger getPrimeExponentQ()


getPrimeP

public BigInteger getPrimeP()


getPrimeQ

public BigInteger getPrimeQ()


getPrivateExponent

public BigInteger getPrivateExponent()


valueOf

public static GnuRSAPrivateKey valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() method of an RSA keypair codec object (an instance implementing IKeyPairCodec for RSA keys, and re-constructs an instance of this object.

Parameters:
k - the contents of a previously encoded instance of this object.


Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.