static OpenSSLKey fromPrivateKeyForTLSStackOnly(
            PrivateKey privateKey, PublicKey publicKey) throws InvalidKeyException {
        OpenSSLKey result = getOpenSSLKey(privateKey);
        if (result != null) {
            return result;
        }

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

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

@param privateKey private key.
@param publicKey corresponding public key or {@code null} if not available. Some opaque
       private keys cannot be used by the TLS/SSL stack without the public key.
common/src/main/java/org/conscrypt/OpenSSLKey.java