OpenBSD manual page server

Manual Page Search Parameters

X509_ALGOR_DUP(3) Library Functions Manual X509_ALGOR_DUP(3)

X509_ALGOR_new, X509_ALGOR_free, X509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0, X509_ALGOR_set_md, X509_ALGOR_cmpcreate, change, and inspect algorithm identifiers

#include <openssl/x509.h>

X509_ALGOR *
X509_ALGOR_new(void);

void
X509_ALGOR_free(X509_ALGOR *alg);

X509_ALGOR *
X509_ALGOR_dup(X509_ALGOR *alg);

int
X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);

void
X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, const void **ppval, const X509_ALGOR *alg);

void
X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);

int
X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);

() allocates and initializes an empty X509_ALGOR object, representing an ASN.1 AlgorithmIdentifier structure defined in RFC 5280 section 4.1.1.2. Such objects can specify a cryptographic algorithm together with algorithm-specific parameters. They are used by many other objects, for example certificates, certificate revocation lists, and certificate requests.

() frees alg.

() copies alg by calling i2d_X509_ALGOR(3) and d2i_X509_ALGOR(3).

() sets the algorithm OID of alg to aobj and the associated parameter type to ptype with value pval. If ptype is V_ASN1_UNDEF the parameter is omitted, otherwise ptype and pval have the same meaning as the type and value parameters to ASN1_TYPE_set(3). All the supplied parameters are used internally so must be freed after this call.

() is the inverse of X509_ALGOR_set0(): it returns the algorithm OID in *paobj and the associated parameter in *pptype and *ppval from alg.

() sets alg to appropriate values for the message digest md.

() compares a and b.

X509_ALGOR_new() and X509_ALGOR_dup() return a new X509_ALGOR object or NULL if an error occurs.

X509_ALGOR_set0() returns 1 for success or 0 for failure.

X509_ALGOR_cmp() returns 0 if a and b have identical encodings or non-zero otherwise.

ASN1_TYPE_set(3), d2i_X509_ALGOR(3), X509_get0_signature(3), X509_PUBKEY_get0_param(3)

RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile

X509_ALGOR_new() and X509_ALGOR_free() appeared before SSLeay 0.8 and have been available since OpenBSD 2.4.

X509_ALGOR_dup() first appeared in SSLeay 0.9.1 and has been avialable since OpenBSD 2.6.

X509_ALGOR_set0() and X509_ALGOR_get0() first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 4.5.

X509_ALGOR_cmp() first appeared in OpenSSL 0.9.8zd and 1.0.0p and has been available since OpenBSD 4.9.

X509_ALGOR_set_md() first appeared in OpenSSL 1.0.1 and has been available since OpenBSD 5.3.

March 23, 2018 OpenBSD-6.3