openssl: Simplify wrapping private key objects

This commit is contained in:
Tobias Brunner
2025-08-21 16:11:13 +02:00
parent 0391450376
commit 135ed6aada
5 changed files with 51 additions and 79 deletions
@@ -57,6 +57,15 @@ bool openssl_compute_shared_key(EVP_PKEY *priv, EVP_PKEY *pub, chunk_t *shared);
*/
bool openssl_fingerprint(EVP_PKEY *key, cred_encoding_type_t type, chunk_t *fp);
/**
* Wrap the given OpenSSL private key in a type-specific private key object.
*
* @param key key object to wrap
* @param engine TRUE if key can't be accessed directly
* @returns created object or NULL if key type is not supported
*/
private_key_t *openssl_wrap_private_key(EVP_PKEY *key, bool engine);
/**
* Concatenates two bignums into a chunk, thereby enforcing the length of
* a single BIGNUM, if necessary, by prepending it with zeros.