=pod =head1 NAME X509_add_cert, X509_add_certs - X509 certificate list addition functions =head1 SYNOPSIS #include int X509_add_cert(STACK_OF(X509) *sk, X509 *cert, int flags); int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs, int flags); =head1 DESCRIPTION X509_add_cert() adds a certificate I to the given list I. X509_add_certs() adds a list of certificate I to the given list I. The I argument may be NULL, which implies no effect. It does not modify the list I but in case the B flag (described below) is set the reference counters of those of its members added to I are increased. Both these functions have a I parameter, which is used to control details of the operation. The value B, which equals 0, means no special semantics. If B is set then the reference counts of those certificates added successfully are increased. If B is set then the certifcates are prepended to I. By default they are appended to I. In both cases the original order of the added certificates is preserved. If B is set then certificates already contained in I, which is determined using L, are ignored. If B is set then certificates that are marked self-signed, which is determined using L, are ignored. =head1 RETURN VALUES Both functions return 1 for success and 0 for failure. =head1 NOTES If X509_add_certs() is used with the flags B or B it is advisable to use also B because otherwise likely not for all members of the I list the ownership is transferred to the list of certificates I. Care should also be taken in case the I argument equals I. =head1 SEE ALSO L L =head1 HISTORY The functions X509_add_cert() and X509_add_certs() were added in OpenSSL 3.0. =head1 COPYRIGHT Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L. =cut