static OpenSSLKey wrapJCAPrivateKeyForTLSStackOnly(PrivateKey privateKey,
            PublicKey publicKey) throws InvalidKeyException {
        ECParameterSpec params = null;
        if (privateKey instanceof ECKey) {
            params = ((ECKey) privateKey).getParams();
        } else if (publicKey instanceof ECKey) {
            params = ((ECKey) publicKey).getParams();
        }
        if (params == null) {
            throw new InvalidKeyException("EC parameters not available. Private: " + privateKey
                    + ", public: " + publicKey);
        }
        return wrapJCAPrivateKeyForTLSStackOnly(privateKey, params);
    }
Wraps the provided private key for use in the TLS/SSL stack only. Sign/decrypt operations
using the key will be delegated to the {@code Signature}/{@code Cipher} implementation of the
provider which accepts the key.
common/src/main/java/org/conscrypt/OpenSSLECPrivateKey.java