RSAPublicKeySpec

  • RSAPublicKeySpec specifies an RSA public key using its modulus and public exponent.

  • It provides methods to retrieve the modulus (getModulus()) and public exponent (getPublicExponent()) values.

  • RSAPublicKeySpec implements the KeySpec interface and can be used with KeyFactory to generate an RSA public key object.

  • This class is essential for working with RSA public keys in Java security.

public class RSAPublicKeySpec extends Object
implements KeySpec

This class specifies an RSA public key.

Public Constructor Summary

RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent)
Creates a new RSAPublicKeySpec.

Public Method Summary

BigInteger
getModulus()
Returns the modulus.
BigInteger
getPublicExponent()
Returns the public exponent.

Inherited Method Summary

Public Constructors

public RSAPublicKeySpec (BigInteger modulus, BigInteger publicExponent)

Creates a new RSAPublicKeySpec.

Parameters
modulus the modulus
publicExponent the public exponent

Public Methods

public BigInteger getModulus ()

Returns the modulus.

Returns
  • the modulus

public BigInteger getPublicExponent ()

Returns the public exponent.

Returns
  • the public exponent