load provider keys from handle
This code uses the openssl 3.x OSSL_STORE_* APIs to load key objects. The older d2i_* and PEM_read_* do not interact at all with providers. This does not solve generating keys using a provider.
"handle" seems to be a TPM terminology. Since OpenSSL's man page for OSSL_STORE_open() only says that it takes an URI, "uri" would be a better name here.
This needs changes:
- Please add tests.
- The code formatting should match the existing style.
OSSL_STORE_INFO_get1_PKEY()appears to handle private keys only, not public keys or parameters-only pkeys.- The second parameter
pwdis unused. OSSL_STOREandOSSL_STORE_INFOare not freed.
The older d2i_* and PEM_read_* do not interact at all with providers.
ruby/openssl uses OSSL_DECODER with OpenSSL 3 instead of d2i_*() and PEM_read_*() functions. It does actually interact with providers, as long as the provider supports encoding the key reference into DER/PEM.
Support for OSSL_STORE_open() would be useful. This should resolve https://github.com/ruby/openssl/issues/722.