Package org.conscrypt
Class OpenSSLECPrivateKey
- java.lang.Object
-
- org.conscrypt.OpenSSLECPrivateKey
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.interfaces.ECKey
,java.security.interfaces.ECPrivateKey
,java.security.Key
,java.security.PrivateKey
,javax.security.auth.Destroyable
,OpenSSLKeyHolder
final class OpenSSLECPrivateKey extends java.lang.Object implements java.security.interfaces.ECPrivateKey, OpenSSLKeyHolder
An implementation of aPrivateKey
for EC keys based on BoringSSL.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALGORITHM
protected OpenSSLECGroupContext
group
protected OpenSSLKey
key
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description OpenSSLECPrivateKey(java.security.spec.ECPrivateKeySpec ecKeySpec)
OpenSSLECPrivateKey(OpenSSLECGroupContext group, OpenSSLKey key)
OpenSSLECPrivateKey(OpenSSLKey key)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getAlgorithm()
byte[]
getEncoded()
java.lang.String
getFormat()
(package private) static OpenSSLKey
getInstance(java.security.interfaces.ECPrivateKey ecPrivateKey)
OpenSSLKey
getOpenSSLKey()
java.security.spec.ECParameterSpec
getParams()
private java.math.BigInteger
getPrivateKey()
java.math.BigInteger
getS()
int
hashCode()
private void
readObject(java.io.ObjectInputStream stream)
java.lang.String
toString()
(package private) static OpenSSLKey
wrapJCAPrivateKeyForTLSStackOnly(java.security.PrivateKey privateKey, java.security.PublicKey publicKey)
Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKey
wrapJCAPrivateKeyForTLSStackOnly(java.security.PrivateKey privateKey, java.security.spec.ECParameterSpec params)
Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKey
wrapPlatformKey(java.security.interfaces.ECPrivateKey ecPrivateKey)
private static OpenSSLKey
wrapPlatformKey(java.security.interfaces.ECPrivateKey ecPrivateKey, OpenSSLECGroupContext group)
private void
writeObject(java.io.ObjectOutputStream stream)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ALGORITHM
private static final java.lang.String ALGORITHM
- See Also:
- Constant Field Values
-
key
protected transient OpenSSLKey key
-
group
protected transient OpenSSLECGroupContext group
-
-
Constructor Detail
-
OpenSSLECPrivateKey
OpenSSLECPrivateKey(OpenSSLECGroupContext group, OpenSSLKey key)
-
OpenSSLECPrivateKey
OpenSSLECPrivateKey(OpenSSLKey key)
-
OpenSSLECPrivateKey
OpenSSLECPrivateKey(java.security.spec.ECPrivateKeySpec ecKeySpec) throws java.security.spec.InvalidKeySpecException
- Throws:
java.security.spec.InvalidKeySpecException
-
-
Method Detail
-
wrapPlatformKey
static OpenSSLKey wrapPlatformKey(java.security.interfaces.ECPrivateKey ecPrivateKey) throws java.security.InvalidKeyException
- Throws:
java.security.InvalidKeyException
-
wrapJCAPrivateKeyForTLSStackOnly
static OpenSSLKey wrapJCAPrivateKeyForTLSStackOnly(java.security.PrivateKey privateKey, java.security.PublicKey publicKey) throws java.security.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:
java.security.InvalidKeyException
-
wrapJCAPrivateKeyForTLSStackOnly
static OpenSSLKey wrapJCAPrivateKeyForTLSStackOnly(java.security.PrivateKey privateKey, java.security.spec.ECParameterSpec params) throws java.security.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:
java.security.InvalidKeyException
-
wrapPlatformKey
private static OpenSSLKey wrapPlatformKey(java.security.interfaces.ECPrivateKey ecPrivateKey, OpenSSLECGroupContext group) throws java.security.InvalidKeyException
- Throws:
java.security.InvalidKeyException
-
getInstance
static OpenSSLKey getInstance(java.security.interfaces.ECPrivateKey ecPrivateKey) 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
-
getParams
public java.security.spec.ECParameterSpec getParams()
- Specified by:
getParams
in interfacejava.security.interfaces.ECKey
-
getS
public java.math.BigInteger getS()
- Specified by:
getS
in interfacejava.security.interfaces.ECPrivateKey
-
getPrivateKey
private java.math.BigInteger getPrivateKey()
-
getOpenSSLKey
public OpenSSLKey getOpenSSLKey()
- Specified by:
getOpenSSLKey
in interfaceOpenSSLKeyHolder
-
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
-
-