Package org.conscrypt

Class OpenSSLRSAPublicKey

  • All Implemented Interfaces:
    java.io.Serializable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPublicKey, java.security.Key, java.security.PublicKey, OpenSSLKeyHolder

    @Internal
    public class OpenSSLRSAPublicKey
    extends java.lang.Object
    implements java.security.interfaces.RSAPublicKey, OpenSSLKeyHolder
    An implementation of PublicKey for RSA keys which uses BoringSSL to perform all the operations.
    See Also:
    Serialized Form
    • Field Detail

      • publicExponent

        private java.math.BigInteger publicExponent
      • modulus

        private java.math.BigInteger modulus
      • fetchedParams

        private transient boolean fetchedParams
    • Constructor Detail

      • OpenSSLRSAPublicKey

        OpenSSLRSAPublicKey​(OpenSSLKey key)
      • OpenSSLRSAPublicKey

        OpenSSLRSAPublicKey​(java.security.spec.RSAPublicKeySpec spec)
                     throws java.security.spec.InvalidKeySpecException
        Throws:
        java.security.spec.InvalidKeySpecException
    • Method Detail

      • getInstance

        static OpenSSLKey getInstance​(java.security.interfaces.RSAPublicKey rsaPublicKey)
                               throws java.security.InvalidKeyException
        Throws:
        java.security.InvalidKeyException
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Specified by:
        getAlgorithm in interface java.security.Key
      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in interface java.security.Key
      • getEncoded

        public byte[] getEncoded()
        Specified by:
        getEncoded in interface java.security.Key
      • ensureReadParams

        private void ensureReadParams()
      • getModulus

        public java.math.BigInteger getModulus()
        Specified by:
        getModulus in interface java.security.interfaces.RSAKey
      • getPublicExponent

        public java.math.BigInteger getPublicExponent()
        Specified by:
        getPublicExponent in interface java.security.interfaces.RSAPublicKey
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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

        private void readObject​(java.io.ObjectInputStream stream)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream stream)
                          throws java.io.IOException
        Throws:
        java.io.IOException