Class RSAPublicKey

  • All Implemented Interfaces:
    java.io.Serializable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class RSAPublicKey
    extends DecodedPublicKey
    This class provides a data structure for representing the information contained in an RSA public key in an X.509 certificate. As per RFC 8017 section A.1.1, an RSA public key is identified by OID 1.2.840.113549.1.1.1 and the value is encoded as follows:
       RSAPublicKey ::= SEQUENCE {
          modulus            INTEGER,    -- n
          publicExponent     INTEGER  }  -- e
     
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.math.BigInteger getModulus()
      Retrieves the modulus (n) for the RSA public key.
      java.math.BigInteger getPublicExponent()
      Retrieves the public exponent (e) for the RSA public key.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this decoded public key to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getModulus

        public java.math.BigInteger getModulus()
        Retrieves the modulus (n) for the RSA public key.
        Returns:
        The modulus for the RSA public key.
      • getPublicExponent

        public java.math.BigInteger getPublicExponent()
        Retrieves the public exponent (e) for the RSA public key.
        Returns:
        The public exponent for the RSA public key.
      • toString

        public void toString​(java.lang.StringBuilder buffer)
        Appends a string representation of this decoded public key to the provided buffer.
        Specified by:
        toString in class DecodedPublicKey
        Parameters:
        buffer - The buffer to which the information should be appended.