xref: /netbsd-src/crypto/external/bsd/openssl/dist/doc/man3/X509_ALGOR_dup.pod (revision b0d1725196a7921d003d2c66a14f186abda4176b)
113d40330Schristos=pod
213d40330Schristos
313d40330Schristos=head1 NAME
413d40330Schristos
5f30e0929SchristosX509_ALGOR_dup, X509_ALGOR_set0, X509_ALGOR_get0, X509_ALGOR_set_md, X509_ALGOR_cmp, X509_ALGOR_copy - AlgorithmIdentifier functions
613d40330Schristos
713d40330Schristos=head1 SYNOPSIS
813d40330Schristos
913d40330Schristos #include <openssl/x509.h>
1013d40330Schristos
1113d40330Schristos X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *alg);
1213d40330Schristos int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
1313d40330Schristos void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype,
1413d40330Schristos                      const void **ppval, const X509_ALGOR *alg);
1513d40330Schristos void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
1613d40330Schristos int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
17f30e0929Schristos int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src);
1813d40330Schristos
1913d40330Schristos=head1 DESCRIPTION
2013d40330Schristos
2113d40330SchristosX509_ALGOR_dup() returns a copy of B<alg>.
2213d40330Schristos
2313d40330SchristosX509_ALGOR_set0() sets the algorithm OID of B<alg> to B<aobj> and the
2413d40330Schristosassociated parameter type to B<ptype> with value B<pval>. If B<ptype> is
2513d40330SchristosB<V_ASN1_UNDEF> the parameter is omitted, otherwise B<ptype> and B<pval> have
2613d40330Schristosthe same meaning as the B<type> and B<value> parameters to ASN1_TYPE_set().
2713d40330SchristosAll the supplied parameters are used internally so must B<NOT> be freed after
2813d40330Schristosthis call.
2913d40330Schristos
3013d40330SchristosX509_ALGOR_get0() is the inverse of X509_ALGOR_set0(): it returns the
3113d40330Schristosalgorithm OID in B<*paobj> and the associated parameter in B<*pptype>
3213d40330Schristosand B<*ppval> from the B<AlgorithmIdentifier> B<alg>.
3313d40330Schristos
3413d40330SchristosX509_ALGOR_set_md() sets the B<AlgorithmIdentifier> B<alg> to appropriate
3513d40330Schristosvalues for the message digest B<md>.
3613d40330Schristos
3713d40330SchristosX509_ALGOR_cmp() compares B<a> and B<b> and returns 0 if they have identical
38f30e0929Schristosencodings and nonzero otherwise.
39f30e0929Schristos
40f30e0929SchristosX509_ALGOR_copy() copies the source values into the dest structs; making
41f30e0929Schristosa duplicate of each (and free any thing pointed to from within *dest).
4213d40330Schristos
4313d40330Schristos=head1 RETURN VALUES
4413d40330Schristos
4513d40330SchristosX509_ALGOR_dup() returns a valid B<X509_ALGOR> structure or NULL if an error
4613d40330Schristosoccurred.
4713d40330Schristos
48f30e0929SchristosX509_ALGOR_set0() and X509_ALGOR_copy() return 1 on success or 0 on error.
4913d40330Schristos
5013d40330SchristosX509_ALGOR_get0() and X509_ALGOR_set_md() return no values.
5113d40330Schristos
5213d40330SchristosX509_ALGOR_cmp() returns 0 if the two parameters have identical encodings and
53f30e0929Schristosnonzero otherwise.
54f30e0929Schristos
55f30e0929Schristos=head1 HISTORY
56f30e0929Schristos
57f30e0929SchristosThe X509_ALGOR_copy() was added in 1.1.1e.
5813d40330Schristos
5913d40330Schristos=head1 COPYRIGHT
6013d40330Schristos
61f30e0929SchristosCopyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
6213d40330Schristos
63*b0d17251SchristosLicensed under the Apache License 2.0 (the "License").  You may not use
6413d40330Schristosthis file except in compliance with the License.  You can obtain a copy
6513d40330Schristosin the file LICENSE in the source distribution or at
6613d40330SchristosL<https://www.openssl.org/source/license.html>.
6713d40330Schristos
6813d40330Schristos=cut
69