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 ofPublicKey
for RSA keys which uses BoringSSL to perform all the operations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
fetchedParams
private OpenSSLKey
key
private java.math.BigInteger
modulus
private java.math.BigInteger
publicExponent
private static long
serialVersionUID
-
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 void
ensureReadParams()
boolean
equals(java.lang.Object o)
java.lang.String
getAlgorithm()
byte[]
getEncoded()
java.lang.String
getFormat()
(package private) static OpenSSLKey
getInstance(java.security.interfaces.RSAPublicKey rsaPublicKey)
java.math.BigInteger
getModulus()
OpenSSLKey
getOpenSSLKey()
java.math.BigInteger
getPublicExponent()
int
hashCode()
private void
readObject(java.io.ObjectInputStream stream)
java.lang.String
toString()
private void
writeObject(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:
getOpenSSLKey
in 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:
getAlgorithm
in interfacejava.security.Key
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormat
in interfacejava.security.Key
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncoded
in interfacejava.security.Key
-
ensureReadParams
private void ensureReadParams()
-
getModulus
public java.math.BigInteger getModulus()
- Specified by:
getModulus
in interfacejava.security.interfaces.RSAKey
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
- Specified by:
getPublicExponent
in interfacejava.security.interfaces.RSAPublicKey
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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
-
-