xref: /freebsd/crypto/openssl/doc/man3/X509_ALGOR_dup.pod (revision e71b70530d95c4f34d8bdbd78d1242df1ba4a945)
1*e71b7053SJung-uk Kim=pod
2*e71b7053SJung-uk Kim
3*e71b7053SJung-uk Kim=head1 NAME
4*e71b7053SJung-uk Kim
5*e71b7053SJung-uk KimX509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0, X509_ALGOR_set_md, X509_ALGOR_cmp - AlgorithmIdentifier functions
6*e71b7053SJung-uk Kim
7*e71b7053SJung-uk Kim=head1 SYNOPSIS
8*e71b7053SJung-uk Kim
9*e71b7053SJung-uk Kim #include <openssl/x509.h>
10*e71b7053SJung-uk Kim
11*e71b7053SJung-uk Kim X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *alg);
12*e71b7053SJung-uk Kim int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
13*e71b7053SJung-uk Kim void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
14*e71b7053SJung-uk Kim                      const void **ppval, const X509_ALGOR *alg);
15*e71b7053SJung-uk Kim void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
16*e71b7053SJung-uk Kim int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
17*e71b7053SJung-uk Kim
18*e71b7053SJung-uk Kim=head1 DESCRIPTION
19*e71b7053SJung-uk Kim
20*e71b7053SJung-uk KimX509_ALGOR_dup() returns a copy of B<alg>.
21*e71b7053SJung-uk Kim
22*e71b7053SJung-uk KimX509_ALGOR_set0() sets the algorithm OID of B<alg> to B<aobj> and the
23*e71b7053SJung-uk Kimassociated parameter type to B<ptype> with value B<pval>. If B<ptype> is
24*e71b7053SJung-uk KimB<V_ASN1_UNDEF> the parameter is omitted, otherwise B<ptype> and B<pval> have
25*e71b7053SJung-uk Kimthe same meaning as the B<type> and B<value> parameters to ASN1_TYPE_set().
26*e71b7053SJung-uk KimAll the supplied parameters are used internally so must B<NOT> be freed after
27*e71b7053SJung-uk Kimthis call.
28*e71b7053SJung-uk Kim
29*e71b7053SJung-uk KimX509_ALGOR_get0() is the inverse of X509_ALGOR_set0(): it returns the
30*e71b7053SJung-uk Kimalgorithm OID in B<*paobj> and the associated parameter in B<*pptype>
31*e71b7053SJung-uk Kimand B<*ppval> from the B<AlgorithmIdentifier> B<alg>.
32*e71b7053SJung-uk Kim
33*e71b7053SJung-uk KimX509_ALGOR_set_md() sets the B<AlgorithmIdentifier> B<alg> to appropriate
34*e71b7053SJung-uk Kimvalues for the message digest B<md>.
35*e71b7053SJung-uk Kim
36*e71b7053SJung-uk KimX509_ALGOR_cmp() compares B<a> and B<b> and returns 0 if they have identical
37*e71b7053SJung-uk Kimencodings and non-zero otherwise.
38*e71b7053SJung-uk Kim
39*e71b7053SJung-uk Kim=head1 RETURN VALUES
40*e71b7053SJung-uk Kim
41*e71b7053SJung-uk KimX509_ALGOR_dup() returns a valid B<X509_ALGOR> structure or NULL if an error
42*e71b7053SJung-uk Kimoccurred.
43*e71b7053SJung-uk Kim
44*e71b7053SJung-uk KimX509_ALGOR_set0() returns 1 on success or 0 on error.
45*e71b7053SJung-uk Kim
46*e71b7053SJung-uk KimX509_ALGOR_get0() and X509_ALGOR_set_md() return no values.
47*e71b7053SJung-uk Kim
48*e71b7053SJung-uk KimX509_ALGOR_cmp() returns 0 if the two parameters have identical encodings and
49*e71b7053SJung-uk Kimnon-zero otherwise.
50*e71b7053SJung-uk Kim
51*e71b7053SJung-uk Kim=head1 COPYRIGHT
52*e71b7053SJung-uk Kim
53*e71b7053SJung-uk KimCopyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
54*e71b7053SJung-uk Kim
55*e71b7053SJung-uk KimLicensed under the OpenSSL license (the "License").  You may not use
56*e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
57*e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
58*e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
59*e71b7053SJung-uk Kim
60*e71b7053SJung-uk Kim=cut
61