EVP_PKEY_TODATA(3ossl)
πΈ NAME πΈ
Bestie, this is the OpenSSL EVP_PKEY_TODATA(3ossl) manual page β iconic. π
EVP_PKEY_todata, EVP_PKEY_export β functions to return keys as an array of key parameters.
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
int EVP_PKEY_todata(const EVP_PKEY *pkey, int selection, OSSL_PARAM **params);
int EVP_PKEY_export(const EVP_PKEY *pkey, int selection,
OSSL_CALLBACK *export_cb, void *export_cbarg);
π«Ά DESCRIPTION π«Ά
Okay so the functions on this page extract EVP_PKEY key values as an array of OSSL_PARAM(3). Cute, right? π
EVP_PKEY_todata()β extracts values from a keypkeyusingselection. Theselectionsituation is described in"Selections"inEVP_PKEY_fromdata(3). And bestie,OSSL_PARAM_free(3)should be used to free the returned parameters in*params. Cleanup era, no cap. π§EVP_PKEY_export()β is similar toEVP_PKEY_todata()but uses a callbackexport_cbthat gets passed the value ofexport_cbarg. Seeopenssl-core.h(7)for more information about the callback. π¦
π¨ Important vibe check: theOSSL_PARAM(3)array that is passed to the callback is not persistent after the callback returns. The user must preserve the items of interest, or useEVP_PKEY_todata()if persistence is required. Preserve or perish, iykyk. π
π NOTES π
These functions only work with key management methods coming from a provider. Provider-only, periodt. π This is the mirror function to EVP_PKEY_fromdata(3).
π RETURN VALUES π
EVP_PKEY_todata() and EVP_PKEY_export() return 1 for success and 0 for failure. Success slay; failure, wellβ¦ π
π₯ SEE ALSO π₯
OSSL_PARAM(3)openssl-core.h(7)EVP_PKEY_fromdata(3)EVP_PKEY-RSA(7)EVP_PKEY-EC(7)EVP_PKEY-DSA(7)EVP_PKEY-ED25519(7)EVP_PKEY-ED448(7)EVP_PKEY-DH(7)EVP_PKEY-X25519(7)EVP_PKEY-X448(7)EVP_PKEY-ML-DSA(7)EVP_PKEY-ML-KEM(7)EVP_PKEY-SLH-DSA(7)
β HISTORY β
These functions were added in OpenSSL 3.0. π
Support for ML-DSA, ML-KEM and SLH-DSA was added in OpenSSL 3.5. β¨
π COPYRIGHT π
Copyright 2021-2025 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>. π«Ά
π Thatβs the whole page, bestie. Source/version:3.5.0; date:2026-09-25; manual:EVP_PKEY_TODATA(3ossl). Periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms