GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
X509AT_GET_ATTR(3) FreeBSD Library Functions Manual X509AT_GET_ATTR(3)

X509at_get_attr, X509at_get_attr_count, X509at_get_attr_by_OBJ, X509at_get_attr_by_NID, X509at_get0_data_by_OBJ
X.501 Attribute array read accessors

#include <openssl/x509.h>

X509_ATTRIBUTE *
X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *attrs, int index);

int
X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *attrs);

int
X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *attrs, const ASN1_OBJECT *obj, int start_after);

int
X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *attrs, int nid, int start_after);

void *
X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *attrs, const ASN1_OBJECT *obj, int start_after, int type);

These functions retrieve information from the attrs array of X.501 Attribute objects. They all fail if attrs is a NULL pointer.

X509at_get_attr() returns the array element at the zero-based index. It fails if the index is negative or greater than or equal to the number of objects in the array.

X509at_get_attr_count() returns the number of objects currently stored in the array.

The three remaining functions search the array starting after the index start_after. They fail if no matching object is found. X509at_get0_data_by_OBJ() also fails if the data is not of the requested type.

Additionally, the start_after argument of X509at_get0_data_by_OBJ() is interpreted in a special way. If start_after is -2 or smaller, X509at_get0_data_by_OBJ() also fails if attrs contains more than one matching object. If start_after is -3 or smaller, it also fails unless the matching object contains exactly one value.

X509at_get_attr() returns an internal pointer or or NULL on failure.

X509at_get_attr_count() returns the number of array elements or -1 on failure.

X509at_get_attr_by_OBJ() and X509at_get_attr_by_NID() return the index of the first object in the array that has an index greater than start_after and a type matching obj or nid, respectively, or -1 on failure. In addition, X509at_get_attr_by_NID() returns -2 if OBJ_nid2obj(3) fails on the requested nid.

X509at_get0_data_by_OBJ() returns an internal pointer to the data contained in the value of the first object that has an index greater than start_after and a type matching obj, or NULL on failure.

EVP_PKEY_get_attr(3), OBJ_nid2obj(3), PKCS8_pkey_get0_attrs(3), STACK_OF(3), X509_ATTRIBUTE_get0_data(3), X509_ATTRIBUTE_new(3), X509_REQ_get_attr(3), X509at_add1_attr(3)

X509at_get_attr(), X509at_get_attr_count(), X509at_get_attr_by_OBJ(), and X509at_get_attr_by_NID() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

X509at_get0_data_by_OBJ() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 4.5.

November 26, 2021 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.