X509at_get0_data_by_OBJ

Return attribute data matching an OID from a stack of X509_ATTRIBUTE values.

Synopsis

Declared in <openssl/x509.h>

void*
X509at_get0_data_by_OBJ(
    stack_st_X509_ATTRIBUTE const* x,
    ASN1_OBJECT const* obj,
    int lastpos,
    int type);

Return Value

Internal pointer to the attribute data (do not free), or NULL if not found / type mismatch.

Parameters

NameDescription
xAttribute stack to search.
objAttribute type OID to locate.
lastposIndex to search after, or -1 to start from the beginning.
typeExpected ASN.1 type of the attribute value (for example V_ASN1_OCTET_STRING).