- NAME
- SYNOPSIS
- DESCRIPTION
- NOTES
- RETURN VALUES
- SEE ALSO
- HISTORY
- COPYRIGHT

# NAME

EVP_PKEY_param_fromdata_init, EVP_PKEY_key_fromdata_init, EVP_PKEY_fromdata, EVP_PKEY_param_fromdata_settable, EVP_PKEY_key_fromdata_settable - functions to create key parameters and keys from user data

# SYNOPSIS

     #include <openssl/evp.h>

     int EVP_PKEY_param_fromdata_init(EVP_PKEY_CTX *ctx);
     int EVP_PKEY_key_fromdata_init(EVP_PKEY_CTX *ctx);
     int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM params[]);
     const OSSL_PARAM *EVP_PKEY_param_fromdata_settable(EVP_PKEY_CTX *ctx);
     const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx);

# DESCRIPTION

`EVP_PKEY_param_fromdata_init()` initializes a public key algorithm context for creating key parameters from user data.

`EVP_PKEY_key_fromdata_init()` initializes a public key algorithm context for creating a key from user data.

`EVP_PKEY_fromdata()` creates key parameters or a key, given data from params and a context that's been initialized with `EVP_PKEY_param_fromdata_init()` or `EVP_PKEY_key_fromdata_init()`. The result is written to *ppkey. The parameters that can be used for various types of key are as described in the "Built-in RSA Import/Export Types" section on the provider-keymgmt(7) page.

`EVP_PKEY_param_fromdata_settable()` and `EVP_PKEY_key_fromdata_settable()` get a constant OSSL_PARAM array that describes the settable parameters that can be used with `EVP_PKEY_fromdata()`. See OSSL_PARAM(3) for the use of OSSL_PARAM as parameter descriptor.

# NOTES

These functions only work with key management methods coming from a provider.

# RETURN VALUES

`EVP_PKEY_key_fromdata_init()`, `EVP_PKEY_param_fromdata_init()` and `EVP_PKEY_fromdata()` return 1 for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm.

# SEE ALSO

EVP_PKEY_CTX_new(3), provider(7)

# HISTORY

These functions were added in OpenSSL 3.0.

# COPYRIGHT

Copyright 2019 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.