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 Stringprotected OpenSSLECGroupContextprotected OpenSSLKeyprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionOpenSSLECPrivateKey(ECPrivateKeySpec ecKeySpec) OpenSSLECPrivateKey(OpenSSLECGroupContext group, OpenSSLKey key) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbyte[](package private) static OpenSSLKeygetInstance(ECPrivateKey ecPrivateKey) private BigIntegergetS()inthashCode()private voidreadObject(ObjectInputStream stream) toString()(package private) static OpenSSLKeywrapJCAPrivateKeyForTLSStackOnly(PrivateKey privateKey, PublicKey publicKey) Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKeywrapJCAPrivateKeyForTLSStackOnly(PrivateKey privateKey, ECParameterSpec params) Wraps the provided private key for use in the TLS/SSL stack only.(package private) static OpenSSLKeywrapPlatformKey(ECPrivateKey ecPrivateKey) private static OpenSSLKeywrapPlatformKey(ECPrivateKey ecPrivateKey, OpenSSLECGroupContext group) private voidwriteObject(ObjectOutputStream stream) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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/Cipherimplementation 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/Cipherimplementation 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:
getAlgorithmin interfaceKey
-
getFormat
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncodedin interfaceKey
-
getParams
-
getS
- Specified by:
getSin interfaceECPrivateKey
-
getPrivateKey
-
getOpenSSLKey
- Specified by:
getOpenSSLKeyin interfaceOpenSSLKeyHolder
-
equals
-
hashCode
public int hashCode() -
toString
-
readObject
- Throws:
IOExceptionClassNotFoundException
-
writeObject
- Throws:
IOException
-