Package org.conscrypt
Class OpenSSLECPrivateKey
java.lang.Object
org.conscrypt.OpenSSLECPrivateKey
- All Implemented Interfaces:
Serializable
,ECKey
,ECPrivateKey
,Key
,PrivateKey
,Destroyable
,OpenSSLKeyHolder
An implementation of a
PrivateKey
for EC keys based on BoringSSL.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
protected OpenSSLECGroupContext
protected OpenSSLKey
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSSLECPrivateKey
(ECPrivateKeySpec ecKeySpec) OpenSSLECPrivateKey
(OpenSSLECGroupContext group, OpenSSLKey key) -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
(package private) static OpenSSLKey
getInstance
(ECPrivateKey ecPrivateKey) private BigInteger
getS()
int
hashCode()
private void
readObject
(ObjectInputStream stream) 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
wrapJCAPrivateKeyForTLSStackOnly
(PrivateKey privateKey, ECParameterSpec params) Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKey
wrapPlatformKey
(ECPrivateKey ecPrivateKey) private static OpenSSLKey
wrapPlatformKey
(ECPrivateKey ecPrivateKey, OpenSSLECGroupContext group) 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:
-
ALGORITHM
- See Also:
-
key
-
group
-
-
Constructor Details
-
OpenSSLECPrivateKey
OpenSSLECPrivateKey(OpenSSLECGroupContext group, OpenSSLKey key) -
OpenSSLECPrivateKey
OpenSSLECPrivateKey(OpenSSLKey key) -
OpenSSLECPrivateKey
OpenSSLECPrivateKey(ECPrivateKeySpec ecKeySpec) throws InvalidKeySpecException - Throws:
InvalidKeySpecException
-
-
Method Details
-
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
-
wrapJCAPrivateKeyForTLSStackOnly
static OpenSSLKey wrapJCAPrivateKeyForTLSStackOnly(PrivateKey privateKey, ECParameterSpec params) 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
-
wrapPlatformKey
private static OpenSSLKey wrapPlatformKey(ECPrivateKey ecPrivateKey, OpenSSLECGroupContext group) throws InvalidKeyException - Throws:
InvalidKeyException
-
getInstance
- Throws:
InvalidKeyException
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
-
getFormat
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
-
getParams
-
getS
- Specified by:
getS
in interfaceECPrivateKey
-
getPrivateKey
-
getOpenSSLKey
- Specified by:
getOpenSSLKey
in interfaceOpenSSLKeyHolder
-
equals
-
hashCode
public int hashCode() -
toString
-
readObject
- Throws:
IOException
ClassNotFoundException
-
writeObject
- Throws:
IOException
-