OSSL_PARAM_BLD - Online Linux Manual PageSection : 3ossl
Updated : 2022-03-15
Source : 3.0.2
Note : OpenSSL

NAMEOSSL_PARAM_BLD, OSSL_PARAM_BLD_new, OSSL_PARAM_BLD_to_param, OSSL_PARAM_BLD_free, OSSL_PARAM_BLD_push_int, OSSL_PARAM_BLD_push_uint, OSSL_PARAM_BLD_push_long, OSSL_PARAM_BLD_push_ulong, OSSL_PARAM_BLD_push_int32, OSSL_PARAM_BLD_push_uint32, OSSL_PARAM_BLD_push_int64, OSSL_PARAM_BLD_push_uint64, OSSL_PARAM_BLD_push_size_t, OSSL_PARAM_BLD_push_time_t, OSSL_PARAM_BLD_push_double, OSSL_PARAM_BLD_push_BN, OSSL_PARAM_BLD_push_BN_pad, OSSL_PARAM_BLD_push_utf8_string, OSSL_PARAM_BLD_push_utf8_ptr, OSSL_PARAM_BLD_push_octet_string, OSSL_PARAM_BLD_push_octet_ptr ​− functions to assist in the creation of OSSL_PARAM arrays

SYNOPSIS​ #include <openssl/param_build.h> ​ ​ typedef struct OSSL_PARAM_BLD; ​ ​ OSSL_PARAM_BLD *OSSL_PARAM_BLD_new(void); ​ OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld); ​ void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld); ​ ​ int OSSL_PARAM_BLD_push_TYPE(OSSL_PARAM_BLD *bld, const char *key, TYPE val); ​ ​ int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key, ​ const BIGNUM *bn); ​ int OSSL_PARAM_BLD_push_BN_pad(OSSL_PARAM_BLD *bld, const char *key, ​ const BIGNUM *bn, size_t sz); ​ ​ int OSSL_PARAM_BLD_push_utf8_string(OSSL_PARAM_BLD *bld, const char *key, ​ const char *buf, size_t bsize); ​ int OSSL_PARAM_BLD_push_utf8_ptr(OSSL_PARAM_BLD *bld, const char *key, ​ char *buf, size_t bsize); ​ int OSSL_PARAM_BLD_push_octet_string(OSSL_PARAM_BLD *bld, const char *key, ​ const void *buf, size_t bsize); ​ int OSSL_PARAM_BLD_push_octet_ptr(OSSL_PARAM_BLD *bld, const char *key, ​ void *buf, size_t bsize);

DESCRIPTIONA collection of utility functions that simplify the creation of OSSL_PARAM arrays. The TYPE names are as per OSSL_PARAM_int(3). OSSL_PARAM_BLD_new() allocates and initialises a new OSSL_PARAM_BLD structure so that values can be added. Any existing values are cleared. OSSL_PARAM_BLD_free() deallocates the memory allocates by OSSL_PARAM_BLD_new(). OSSL_PARAM_BLD_to_param() converts a built up OSSL_PARAM_BLD structure ​bld into an allocated OSSL_PARAM array. The OSSL_PARAM array and all associated storage must be freed by calling ​OSSL_PARAM_free() with the functions return value. ​OSSL_PARAM_BLD_free() can safely be called any time after this function is. OSSL_PARAM_BLD_push_TYPE() are a series of functions which will create ​OSSL_PARAM objects of the specified size and correct type for the val argument. ​val is stored by value and an expression or auto variable can be used. OSSL_PARAM_BLD_push_BN() is a function that will create an OSSL_PARAM object that holds the specified BIGNUM bn. If bn is marked as being securely allocated, its OSSL_PARAM representation will also be securely allocated. The bn argument is stored by reference and the underlying BIGNUM object must exist until after OSSL_PARAM_BLD_to_param() has been called. OSSL_PARAM_BLD_push_BN_pad() is a function that will create an OSSL_PARAM object that holds the specified BIGNUM bn. The object will be padded to occupy exactly sz bytes, if insufficient space is specified an error results. If bn is marked as being securely allocated, its OSSL_PARAM representation will also be securely allocated. The bn argument is stored by reference and the underlying BIGNUM object must exist until after OSSL_PARAM_BLD_to_param() has been called. OSSL_PARAM_BLD_push_utf8_string() is a function that will create an OSSL_PARAM object that references the UTF8 string specified by buf. The length of the string bsize should not include the terminating NUL byte. If it is zero then it will be calculated. The string that buf points to is stored by reference and must remain in scope until after OSSL_PARAM_BLD_to_param() has been called. OSSL_PARAM_BLD_push_octet_string() is a function that will create an OSSL_PARAM object that references the octet string specified by buf and <bsize>. The memory that buf points to is stored by reference and must remain in scope until after OSSL_PARAM_BLD_to_param() has been called. OSSL_PARAM_BLD_push_utf8_ptr() is a function that will create an OSSL_PARAM object that references the UTF8 string specified by buf. The length of the string bsize should not include the terminating NUL byte. If it is zero then it will be calculated. The string buf points to is stored by reference and must remain in scope until the OSSL_PARAM array is freed. OSSL_PARAM_BLD_push_octet_ptr() is a function that will create an OSSL_PARAM object that references the octet string specified by buf. The memory buf points to is stored by reference and must remain in scope until the OSSL_PARAM array is freed.

RETURN VALUESOSSL_PARAM_BLD_new() returns the allocated OSSL_PARAM_BLD structure, or NULL on error. OSSL_PARAM_BLD_to_param() returns the allocated OSSL_PARAM array, or NULL on error. All of the OSSL_PARAM_BLD_push_TYPE functions return 1 on success and 0 on error.

NOTESOSSL_PARAM_BLD_push_BN() and OSSL_PARAM_BLD_push_BN_pad() currently only support nonnegative BIGNUMs. They return an error on negative BIGNUMs.

EXAMPLESBoth examples creating an OSSL_PARAM array that contains an RSA key. For both, the predefined key variables are: ​ BIGNUM *p, *q; /* both prime */ ​ BIGNUM *n; /* = p * q */ ​ unsigned int e; /* exponent, usually 65537 */ ​ BIGNUM *d; /* e^−1 */

Example 1This example shows how to create an OSSL_PARAM array that contains an RSA private key. ​ OSSL_PARAM_BLD *bld = OSSL_PARAM_BLD_new(); ​ OSSL_PARAM *params = NULL; ​ ​ if (bld == NULL ​ || !OSSL_PARAM_BLD_push_BN(bld, "p", p) ​ || !OSSL_PARAM_BLD_push_BN(bld, "q", q) ​ || !OSSL_PARAM_BLD_push_uint(bld, "e", e) ​ || !OSSL_PARAM_BLD_push_BN(bld, "n", n) ​ || !OSSL_PARAM_BLD_push_BN(bld, "d", d) ​ || (params = OSSL_PARAM_BLD_to_param(bld)) == NULL) ​ goto err; ​ OSSL_PARAM_BLD_free(bld); ​ /* Use params */ ​ ... ​ OSSL_PARAM_free(params);

Example 2This example shows how to create an OSSL_PARAM array that contains an RSA public key. ​ OSSL_PARAM_BLD *bld = OSSL_PARAM_BLD_new(); ​ OSSL_PARAM *params = NULL; ​ ​ if (nld == NULL ​ || !OSSL_PARAM_BLD_push_BN(bld, "n", n) ​ || !OSSL_PARAM_BLD_push_BN(bld, "d", d) ​ || (params = OSSL_PARAM_BLD_to_param(bld)) == NULL) ​ goto err; ​ OSSL_PARAM_BLD_free(bld); ​ /* Use params */ ​ ... ​ OSSL_PARAM_free(params);

SEE ALSOOSSL_PARAM_int(3), OSSL_PARAM(3), OSSL_PARAM_free(3)

HISTORYThe functions described here were all added in OpenSSL 3.0.

COPYRIGHTCopyright 2019−2021 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>.
0
Johanes Gumabo
Data Size   :   22,245 byte
man-OSSL_PARAM_BLD.3osslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 193,032
Visitor ID   :     :  
Visitor IP   :   18.221.217.100   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|O___SSL_PARAM_BLD.3ossl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|O___SSL_PARAM_BLD.3ossl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|O___SSL_PARAM_BLD.3ossl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|O___SSL_PARAM_BLD.3ossl|43|'br══─}─══ |'br══─}─══ )