public final class

RSAPrivateCrtKeyImpl

extends PKCS8Key
implements RSAPrivateCrtKey
java.lang.Object
   ↳ sun.security.pkcs.PKCS8Key
     ↳ sun.security.rsa.RSAPrivateCrtKeyImpl

Class Overview

Key implementation for RSA private keys, CRT form. For non-CRT private keys, see RSAPrivateKeyImpl. We need separate classes to ensure correct behavior in instanceof checks, etc. Note: RSA keys must be at least 512 bits long

Summary

[Expand]
Inherited Constants
From interface java.security.Key
From interface java.security.PrivateKey
From interface java.security.interfaces.RSAPrivateCrtKey
From interface java.security.interfaces.RSAPrivateKey
[Expand]
Inherited Fields
From class sun.security.pkcs.PKCS8Key
Public Methods
String getAlgorithm()
Returns the algorithm to be used with this key.
BigInteger getCrtCoefficient()
Returns the crtCoefficient.
BigInteger getModulus()
Returns the modulus.
BigInteger getPrimeExponentP()
Returns the primeExponentP.
BigInteger getPrimeExponentQ()
Returns the primeExponentQ.
BigInteger getPrimeP()
Returns the primeP.
BigInteger getPrimeQ()
Returns the primeQ.
BigInteger getPrivateExponent()
Returns the private exponent.
BigInteger getPublicExponent()
Returns the public exponent.
static RSAPrivateKey newKey(byte[] encoded)
Generate a new key from its encoding.
String toString()
Returns a string representation of the object.
Protected Methods
void parseKeyBits()
Parse the key.
[Expand]
Inherited Methods
From class sun.security.pkcs.PKCS8Key
From class java.lang.Object
From interface java.security.Key
From interface java.security.interfaces.RSAKey
From interface java.security.interfaces.RSAPrivateCrtKey
From interface java.security.interfaces.RSAPrivateKey

Public Methods

public String getAlgorithm ()

Returns the algorithm to be used with this key.

Returns
  • the name of the algorithm associated with this key.

public BigInteger getCrtCoefficient ()

Returns the crtCoefficient.

Returns
  • the crtCoefficient

public BigInteger getModulus ()

Returns the modulus.

Returns
  • the modulus

public BigInteger getPrimeExponentP ()

Returns the primeExponentP.

Returns
  • the primeExponentP

public BigInteger getPrimeExponentQ ()

Returns the primeExponentQ.

Returns
  • the primeExponentQ

public BigInteger getPrimeP ()

Returns the primeP.

Returns
  • the primeP

public BigInteger getPrimeQ ()

Returns the primeQ.

Returns
  • the primeQ

public BigInteger getPrivateExponent ()

Returns the private exponent.

Returns
  • the private exponent

public BigInteger getPublicExponent ()

Returns the public exponent.

Returns
  • the public exponent

public static RSAPrivateKey newKey (byte[] encoded)

Generate a new key from its encoding. Returns a CRT key if possible and a non-CRT key otherwise. Used by RSAKeyFactory.

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.

Protected Methods

protected void parseKeyBits ()

Parse the key. Called by PKCS8Key.