Package org.conscrypt
Class OpenSSLRSAPublicKey
- java.lang.Object
-
- org.conscrypt.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 ofPublicKeyfor RSA keys which uses BoringSSL to perform all the operations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private booleanfetchedParamsprivate OpenSSLKeykeyprivate java.math.BigIntegermodulusprivate java.math.BigIntegerpublicExponentprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description OpenSSLRSAPublicKey(java.security.spec.RSAPublicKeySpec spec)OpenSSLRSAPublicKey(OpenSSLKey key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidensureReadParams()booleanequals(java.lang.Object o)java.lang.StringgetAlgorithm()byte[]getEncoded()java.lang.StringgetFormat()(package private) static OpenSSLKeygetInstance(java.security.interfaces.RSAPublicKey rsaPublicKey)java.math.BigIntegergetModulus()OpenSSLKeygetOpenSSLKey()java.math.BigIntegergetPublicExponent()inthashCode()private voidreadObject(java.io.ObjectInputStream stream)java.lang.StringtoString()private voidwriteObject(java.io.ObjectOutputStream stream)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
key
private transient OpenSSLKey key
-
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
-
getOpenSSLKey
public OpenSSLKey getOpenSSLKey()
- Specified by:
getOpenSSLKeyin interfaceOpenSSLKeyHolder
-
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:
getAlgorithmin interfacejava.security.Key
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfacejava.security.Key
-
ensureReadParams
private void ensureReadParams()
-
getModulus
public java.math.BigInteger getModulus()
- Specified by:
getModulusin interfacejava.security.interfaces.RSAKey
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
- Specified by:
getPublicExponentin interfacejava.security.interfaces.RSAPublicKey
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
-