xref: /freebsd/secure/lib/libcrypto/man/man3/OSSL_CMP_ATAV_set0.3 (revision 086ce467adec42d58414fdb4d54c2b6819cf0c07)
-*- mode: troff; coding: utf-8 -*-
Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)

Standard preamble:
========================================================================
..
..
.. \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
. ds C` "" . ds C' "" 'br\} . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF ========================================================================

Title "OSSL_CMP_ATAV_SET0 3ossl"
OSSL_CMP_ATAV_SET0 3ossl 2025-07-01 3.5.1 OpenSSL
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
NAME
OSSL_CMP_ATAV, OSSL_CMP_ATAV_create, OSSL_CMP_ATAV_set0, OSSL_CMP_ATAV_get0_type, OSSL_CMP_ATAV_get0_value, OSSL_CMP_ATAV_new_algId, OSSL_CMP_ATAV_get0_algId, OSSL_CMP_ATAV_new_rsaKeyLen, OSSL_CMP_ATAV_get_rsaKeyLen, OSSL_CMP_ATAVS, OSSL_CMP_ATAV_push1, OSSL_CMP_ATAV_free \- OSSL_CMP_ATAV utility functions
SYNOPSIS
Header "SYNOPSIS" .Vb 1 #include <openssl/cmp.h> \& typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV; OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value); void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *atav, ASN1_OBJECT *type, ASN1_TYPE *value); ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *atav); ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *atav); \& OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg); X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav); OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len); int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav); \& typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS; int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav); void OSSL_CMP_ATAV_free(OSSL_CMP_ATAV *atav); .Ve
DESCRIPTION
Header "DESCRIPTION" \fBOSSL_CMP_ATAV is a short hand of OSSL_CRMF_ATTRIBUTETYPEANDVALUE, defined in RFC 4211 Appendix B. It is typically used in CertRequest structures, but also in CertReqTemplateContent structures for key specifications.

\fBOSSL_CMP_ATAV_create() creates a new OSSL_CMP_ATAV structure and fills it in. It combines OSSL_CMP_ATAV_new() and OSSL_CMP_ATAV_set0().

\fBOSSL_CMP_ATAV_set0() sets the atav with an infoType of type and an infoValue of value. The pointers type and value may be NULL, otherwise they must not be freed up after the call because their ownership is transferred to atav. The itav pointer must not be NULL.

\fBOSSL_CMP_ATAV_get0_type() returns a direct pointer to the infoType in the atav unless it is NULL.

\fBOSSL_CMP_ATAV_get0_value() returns a direct pointer to the infoValue in the atav as generic ASN1_TYPE pointer unless atav is NULL.

\fBOSSL_CMP_ATAV_new_algId() creates a new OSSL_CMP_ATAV structure of type \fBalgId and fills it in with a copy of the given alg.

\fBOSSL_CMP_ATAV_get0_algId() returns a direct pointer to the algId infoValue in the atav of type X509_ALGOR or NULL if atav is NULL or does not contain an algId.

\fBOSSL_CMP_ATAV_new_rsaKeyLen() creates a new OSSL_CMP_ATAV structure of type \fBrsaKeyLen and fills it in with the given len, which must be positive.

\fBOSSL_CMP_ATAV_get_rsaKeyLen() returns the RSA key length in rsaKeyLen infoValue in the atav, \-1 if atav is NULL or does not contain an rsaKeyLen or cannot be parsed, or -2 if the value is less than 1 or is greater than INT_MAX.

\fBOSSL_CMP_ATAV_push1() pushes a copy of atav to the stack of OSSL_CMP_ATAV pointed to by *sk_p. It creates a new stack if *sk_p points to NULL.

\fBOSSL_CMP_ATAV_free() deallocates atav. It is defined as a macro.

NOTES
Header "NOTES" CMP is defined in RFC 4210. CRMF is defined in RFC 4211.
"RETURN VALUES"
Header "RETURN VALUES" \fBOSSL_CMP_ATAV_create(), \fBOSSL_CMP_ATAV_new_algId(), and OSSL_CMP_ATAV_new_rsaKeyLen() return a pointer to the ATAV structure on success, or NULL on error.

\fBOSSL_CMP_ATAV_set0() and OSSL_CMP_ATAV_free() do not return a value.

\fBOSSL_CMP_ATAV_get0_type(), OSSL_CMP_ATAV_get0_value(), and \fBOSSL_CMP_ATAV_get0_algId() return the respective pointer or NULL if their input is NULL.

\fBOSSL_CMP_ATAV_get_rsaKeyLen() return a key length in bits or < 0 on error.

\fBOSSL_CMP_ATAV_push1() returns 1 on success, 0 on error.

"SEE ALSO"
Header "SEE ALSO" \fBOSSL_CMP_ITAV_new0_certReqTemplate\|(3), ASN1_TYPE_set\|(3)
HISTORY
Header "HISTORY" The OSSL_CMP_ATAV type and related functions were added in OpenSSL 3.4.
COPYRIGHT
Header "COPYRIGHT" Copyright 2022-2024 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>.