static OpenSSLKey fromECPrivateKeyForTLSStackOnly(
            PrivateKey key, ECParameterSpec ecParams) throws InvalidKeyException {
        OpenSSLKey result = getOpenSSLKey(key);
        if (result != null) {
            return result;
        }

        result = fromKeyMaterial(key);
        if (result != null) {
            return result;
        }

        return OpenSSLECPrivateKey.wrapJCAPrivateKeyForTLSStackOnly(key, ecParams);
    }
Gets an {@code OpenSSLKey} instance backed by the provided EC private key. The resulting key
is usable only by this provider's TLS/SSL stack.

@param key private key.
@param ecParams EC parameters {@code null} if not available. Some opaque private keys cannot
       be used by the TLS/SSL stack without the parameters because the private key itself
       might not expose the parameters.
common/src/main/java/org/conscrypt/OpenSSLKey.java