libressl-X509_ATTRIBUTE_get0_object(3)

libressl-X509_ATTRIBUTE_get0_object3

X.501 attribute read accessors

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509.h>

ASN1_OBJECT *

X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);

int

X509_ATTRIBUTE_count(const X509_ATTRIBUTE *attr);

ASN1_TYPE *

X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int index);

void *

X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int index, int type, void *data);

Overview

These functions provide read access to the X.501 Attribute object attr.

For X509_ATTRIBUTE_get0_data(), the type argument usually is one of the V_ASN1_* constants defined in ⟨openssl/asn1.h⟩. For example, if a return value of the type ASN1_OCTET_STRING is expected, pass V_ASN1_OCTET_STRING as the type argument. The data argument is ignored; passing NULL is recommended.

Return values

X509_ATTRIBUTE_get0_object() returns an internal pointer to the type of attr or NULL if attr is NULL or if its type is not set.

X509_ATTRIBUTE_count() returns the number of values stored in attr or 0 if no value or values are set.

X509_ATTRIBUTE_get0_type() returns an internal pointer to the ASN.1 ANY object representing the value with the given zero-based index or NULL if attr is NULL, if the index is larger than or equal to the number of values stored in attr, or if no value or values are set.

X509_ATTRIBUTE_get0_data() returns an internal pointer to the data contained in the value with the given zero-based index or NULL if attr is NULL, if the index is larger than or equal to the number of values stored in attr, if no value or values are set, or if the ASN.1 ANY object representing the value with the given index is not of the requested type.

History

These functions first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.