RSAPrivateKeySpec

  • RSAPrivateKeySpec specifies an RSA private key using the modulus and private exponent.

  • It provides methods to retrieve the modulus (getModulus) and private exponent (getPrivateExponent).

  • RSAPrivateKeySpec is extended by RSAPrivateCrtKeySpec and RSAMultiPrimePrivateCrtKeySpec which include Chinese Remainder Theorem (CRT) information for efficiency.

  • This class is used in conjunction with KeyFactory to generate RSA private key objects.

public class RSAPrivateKeySpec extends Object
implements KeySpec
Known Direct Subclasses

This class specifies an RSA private key.

Public Constructor Summary

RSAPrivateKeySpec(BigInteger modulus, BigInteger privateExponent)
Creates a new RSAPrivateKeySpec.

Public Method Summary

BigInteger
getModulus()
Returns the modulus.
BigInteger
getPrivateExponent()
Returns the private exponent.

Inherited Method Summary

Public Constructors

public RSAPrivateKeySpec (BigInteger modulus, BigInteger privateExponent)

Creates a new RSAPrivateKeySpec.

Parameters
modulus the modulus
privateExponent the private exponent

Public Methods

public BigInteger getModulus ()

Returns the modulus.

Returns
  • the modulus

public BigInteger getPrivateExponent ()

Returns the private exponent.

Returns
  • the private exponent