Package org.conscrypt
Class OpenSSLRSAPrivateKey
java.lang.Object
org.conscrypt.OpenSSLRSAPrivateKey
- All Implemented Interfaces:
Serializable
,RSAKey
,RSAPrivateKey
,Key
,PrivateKey
,Destroyable
,OpenSSLKeyHolder
- Direct Known Subclasses:
OpenSSLRSAPrivateCrtKey
An implementation of
PrivateKey
for RSA keys which uses BoringSSL to
perform all the operations.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) OpenSSLKey
(package private) BigInteger
(package private) BigInteger
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSSLRSAPrivateKey
(RSAPrivateKeySpec rsaKeySpec) OpenSSLRSAPrivateKey
(OpenSSLKey key, byte[][] params) -
Method Summary
Modifier and TypeMethodDescription(package private) final void
boolean
final String
final byte[]
final String
(package private) static OpenSSLKey
getInstance
(RSAPrivateKey rsaPrivateKey) (package private) static OpenSSLRSAPrivateKey
getInstance
(OpenSSLKey key) final BigInteger
final BigInteger
int
hashCode()
private static OpenSSLKey
init
(RSAPrivateKeySpec rsaKeySpec) private void
readObject
(ObjectInputStream stream) (package private) void
readParams
(byte[][] params) toString()
(package private) static OpenSSLKey
wrapJCAPrivateKeyForTLSStackOnly
(PrivateKey privateKey, PublicKey publicKey) Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKey
wrapPlatformKey
(RSAPrivateKey rsaPrivateKey) private void
writeObject
(ObjectOutputStream stream) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
key
-
fetchedParams
transient boolean fetchedParams -
modulus
BigInteger modulus -
privateExponent
BigInteger privateExponent
-
-
Constructor Details
-
OpenSSLRSAPrivateKey
OpenSSLRSAPrivateKey(OpenSSLKey key) -
OpenSSLRSAPrivateKey
OpenSSLRSAPrivateKey(OpenSSLKey key, byte[][] params) -
OpenSSLRSAPrivateKey
- Throws:
InvalidKeySpecException
-
-
Method Details
-
getOpenSSLKey
- Specified by:
getOpenSSLKey
in interfaceOpenSSLKeyHolder
-
init
- Throws:
InvalidKeySpecException
-
getInstance
-
wrapPlatformKey
- Throws:
InvalidKeyException
-
wrapJCAPrivateKeyForTLSStackOnly
static OpenSSLKey wrapJCAPrivateKeyForTLSStackOnly(PrivateKey privateKey, PublicKey publicKey) throws InvalidKeyException Wraps the provided private key for use in the TLS/SSL stack only. Sign/decrypt operations using the key will be delegated to theSignature
/Cipher
implementation of the provider which accepts the key.- Throws:
InvalidKeyException
-
getInstance
- Throws:
InvalidKeyException
-
ensureReadParams
final void ensureReadParams() -
readParams
void readParams(byte[][] params) -
getPrivateExponent
- Specified by:
getPrivateExponent
in interfaceRSAPrivateKey
-
getModulus
- Specified by:
getModulus
in interfaceRSAKey
-
getEncoded
public final byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
-
getFormat
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
-
equals
-
hashCode
public int hashCode() -
toString
-
readObject
- Throws:
IOException
ClassNotFoundException
-
writeObject
- Throws:
IOException
-