Blame doc/man3/CMS_get0_SignerInfos.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
CMS_SignerInfo_set1_signer_cert,
Packit c4476c
CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id,
Packit c4476c
CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp
Packit c4476c
- CMS signedData signer functions
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/cms.h>
Packit c4476c
Packit c4476c
 STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
Packit c4476c
Packit c4476c
 int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid,
Packit c4476c
                                   X509_NAME **issuer, ASN1_INTEGER **sno);
Packit c4476c
 ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
Packit c4476c
 int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
Packit c4476c
 void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
The function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures
Packit c4476c
associated with a CMS signedData structure.
Packit c4476c
Packit c4476c
CMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier
Packit c4476c
associated with a specific CMS_SignerInfo structure B<si>. Either the
Packit c4476c
keyidentifier will be set in B<keyid> or B<both> issuer name and serial number
Packit c4476c
in B<issuer> and B<sno>.
Packit c4476c
Packit c4476c
CMS_SignerInfo_get0_signature() retrieves the signature associated with
Packit c4476c
B<si> in a pointer to an ASN1_OCTET_STRING structure. This pointer returned
Packit c4476c
corresponds to the internal signature value if B<si> so it may be read or
Packit c4476c
modified.
Packit c4476c
Packit c4476c
CMS_SignerInfo_cert_cmp() compares the certificate B<cert> against the signer
Packit c4476c
identifier B<si>. It returns zero if the comparison is successful and non zero
Packit c4476c
if not.
Packit c4476c
Packit c4476c
CMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to
Packit c4476c
B<signer>.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
The main purpose of these functions is to enable an application to lookup
Packit c4476c
signers certificates using any appropriate technique when the simpler method
Packit c4476c
of CMS_verify() is not appropriate.
Packit c4476c
Packit c4476c
In typical usage and application will retrieve all CMS_SignerInfo structures
Packit c4476c
using CMS_get0_SignerInfo() and retrieve the identifier information using
Packit c4476c
CMS. It will then obtain the signer certificate by some unspecified means
Packit c4476c
(or return and error if it cannot be found) and set it using
Packit c4476c
CMS_SignerInfo_set1_signer_cert().
Packit c4476c
Packit c4476c
Once all signer certificates have been set CMS_verify() can be used.
Packit c4476c
Packit c4476c
Although CMS_get0_SignerInfos() can return NULL if an error occurs B<or> if
Packit c4476c
there are no signers this is not a problem in practice because the only
Packit c4476c
error which can occur is if the B<cms> structure is not of type signedData
Packit c4476c
due to application error.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
CMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there
Packit c4476c
are no signers or an error occurs.
Packit c4476c
Packit c4476c
CMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure.
Packit c4476c
Packit c4476c
CMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non
Packit c4476c
zero otherwise.
Packit c4476c
Packit c4476c
CMS_SignerInfo_set1_signer_cert() does not return a value.
Packit c4476c
Packit c4476c
Any error can be obtained from L<ERR_get_error(3)>
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ERR_get_error(3)>, L<CMS_verify(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut