org.bouncycastle.jce.provider
Class JCERSAPrivateCrtKey

java.lang.Object
  extended by org.bouncycastle.jce.provider.JCERSAPrivateKey
      extended by org.bouncycastle.jce.provider.JCERSAPrivateCrtKey
All Implemented Interfaces:
java.io.Serializable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateCrtKey, java.security.interfaces.RSAPrivateKey, java.security.Key, java.security.PrivateKey, PKCS12BagAttributeCarrier

public class JCERSAPrivateCrtKey
extends JCERSAPrivateKey
implements java.security.interfaces.RSAPrivateCrtKey

A provider representation for a RSA private key, with CRT factors included.

See Also:
Serialized Form

Field Summary
private  java.math.BigInteger crtCoefficient
           
private  java.math.BigInteger primeExponentP
           
private  java.math.BigInteger primeExponentQ
           
private  java.math.BigInteger primeP
           
private  java.math.BigInteger primeQ
           
private  java.math.BigInteger publicExponent
           
(package private) static long serialVersionUID
           
 
Fields inherited from class org.bouncycastle.jce.provider.JCERSAPrivateKey
modulus, privateExponent
 
Constructor Summary
JCERSAPrivateCrtKey(PrivateKeyInfo info)
          construct an RSA key from a private key info object.
JCERSAPrivateCrtKey(java.security.interfaces.RSAPrivateCrtKey key)
          construct a private key from another RSAPrivateCrtKey.
JCERSAPrivateCrtKey(RSAPrivateCrtKeyParameters key)
          construct a private key from it's org.bouncycastle.crypto equivalent.
JCERSAPrivateCrtKey(java.security.spec.RSAPrivateCrtKeySpec spec)
          construct a private key from an RSAPrivateCrtKeySpec
JCERSAPrivateCrtKey(RSAPrivateKeyStructure key)
          construct an RSA key from a ASN.1 RSA private key object.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.math.BigInteger getCrtCoefficient()
          return the CRT coefficient.
 byte[] getEncoded()
          Return a PKCS8 representation of the key.
 java.lang.String getFormat()
          return the encoding format we produce in getEncoded().
 java.math.BigInteger getPrimeExponentP()
          return the prime exponent for P.
 java.math.BigInteger getPrimeExponentQ()
          return the prime exponent for Q.
 java.math.BigInteger getPrimeP()
          return the prime P.
 java.math.BigInteger getPrimeQ()
          return the prime Q.
 java.math.BigInteger getPublicExponent()
          return the public exponent.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class org.bouncycastle.jce.provider.JCERSAPrivateKey
getAlgorithm, getBagAttribute, getBagAttributeKeys, getModulus, getPrivateExponent, setBagAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.interfaces.RSAPrivateKey
getPrivateExponent
 
Methods inherited from interface java.security.Key
getAlgorithm
 
Methods inherited from interface java.security.interfaces.RSAKey
getModulus
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

publicExponent

private java.math.BigInteger publicExponent

primeP

private java.math.BigInteger primeP

primeQ

private java.math.BigInteger primeQ

primeExponentP

private java.math.BigInteger primeExponentP

primeExponentQ

private java.math.BigInteger primeExponentQ

crtCoefficient

private java.math.BigInteger crtCoefficient
Constructor Detail

JCERSAPrivateCrtKey

JCERSAPrivateCrtKey(RSAPrivateCrtKeyParameters key)
construct a private key from it's org.bouncycastle.crypto equivalent.

Parameters:
key - the parameters object representing the private key.

JCERSAPrivateCrtKey

JCERSAPrivateCrtKey(java.security.spec.RSAPrivateCrtKeySpec spec)
construct a private key from an RSAPrivateCrtKeySpec

Parameters:
spec - the spec to be used in construction.

JCERSAPrivateCrtKey

JCERSAPrivateCrtKey(java.security.interfaces.RSAPrivateCrtKey key)
construct a private key from another RSAPrivateCrtKey.

Parameters:
key - the object implementing the RSAPrivateCrtKey interface.

JCERSAPrivateCrtKey

JCERSAPrivateCrtKey(PrivateKeyInfo info)
construct an RSA key from a private key info object.


JCERSAPrivateCrtKey

JCERSAPrivateCrtKey(RSAPrivateKeyStructure key)
construct an RSA key from a ASN.1 RSA private key object.

Method Detail

getFormat

public java.lang.String getFormat()
return the encoding format we produce in getEncoded().

Specified by:
getFormat in interface java.security.Key
Overrides:
getFormat in class JCERSAPrivateKey
Returns:
the encoding format we produce in getEncoded().

getEncoded

public byte[] getEncoded()
Return a PKCS8 representation of the key. The sequence returned represents a full PrivateKeyInfo object.

Specified by:
getEncoded in interface java.security.Key
Overrides:
getEncoded in class JCERSAPrivateKey
Returns:
a PKCS8 representation of the key.

getPublicExponent

public java.math.BigInteger getPublicExponent()
return the public exponent.

Specified by:
getPublicExponent in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the public exponent.

getPrimeP

public java.math.BigInteger getPrimeP()
return the prime P.

Specified by:
getPrimeP in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the prime P.

getPrimeQ

public java.math.BigInteger getPrimeQ()
return the prime Q.

Specified by:
getPrimeQ in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the prime Q.

getPrimeExponentP

public java.math.BigInteger getPrimeExponentP()
return the prime exponent for P.

Specified by:
getPrimeExponentP in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the prime exponent for P.

getPrimeExponentQ

public java.math.BigInteger getPrimeExponentQ()
return the prime exponent for Q.

Specified by:
getPrimeExponentQ in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the prime exponent for Q.

getCrtCoefficient

public java.math.BigInteger getCrtCoefficient()
return the CRT coefficient.

Specified by:
getCrtCoefficient in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
the CRT coefficient.

hashCode

public int hashCode()
Overrides:
hashCode in class JCERSAPrivateKey

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class JCERSAPrivateKey

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object