Typo fixes
[openssl.git] / doc / crypto / CMS_get0_SignerInfos.pod
1 =pod
2
3 =head1 NAME
4
5 CMS_SignerInfo_set1_signer_cert,
6 CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id,
7 CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp,
8 - CMS signedData signer functions
9
10 =head1 SYNOPSIS
11
12  #include <openssl/cms.h>
13
14  STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
15
16  int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno);
17  ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
18  int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
19  void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
20
21 =head1 DESCRIPTION
22
23 The function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures
24 associated with a CMS signedData structure.
25
26 CMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier
27 associated with a specific CMS_SignerInfo structure B<si>. Either the
28 keyidentifier will be set in B<keyid> or B<both> issuer name and serial number
29 in B<issuer> and B<sno>.
30
31 CMS_SignerInfo_get0_signature() retrieves the signature associated with
32 B<si> in a pointer to an ASN1_OCTET_STRING structure. This pointer returned
33 corresponds to the internal signature value if B<si> so it may be read or
34 modified.
35
36 CMS_SignerInfo_cert_cmp() compares the certificate B<cert> against the signer
37 identifier B<si>. It returns zero if the comparison is successful and non zero
38 if not.
39
40 CMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to
41 B<signer>.
42
43 =head1 NOTES
44
45 The main purpose of these functions is to enable an application to lookup
46 signers certificates using any appropriate technique when the simpler method
47 of CMS_verify() is not appropriate.
48
49 In typical usage and application will retrieve all CMS_SignerInfo structures
50 using CMS_get0_SignerInfo() and retrieve the identifier information using
51 CMS. It will then obtain the signer certificate by some unspecified means
52 (or return and error if it cannot be found) and set it using
53 CMS_SignerInfo_set1_signer_cert().
54
55 Once all signer certificates have been set CMS_verify() can be used.
56
57 Although CMS_get0_SignerInfos() can return NULL is an error occur B<or> if
58 there are no signers this is not a problem in practice because the only
59 error which can occur is if the B<cms> structure is not of type signedData
60 due to application error.
61
62 =head1 RETURN VALUES
63
64 CMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there
65 are no signers or an error occurs.
66
67 CMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure.
68
69 CMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non
70 zero otherwise.
71
72 CMS_SignerInfo_set1_signer_cert() does not return a value.
73
74 Any error can be obtained from L<ERR_get_error(3)>
75
76 =head1 SEE ALSO
77
78 L<ERR_get_error(3)>, L<CMS_verify(3)>
79
80 =head1 COPYRIGHT
81
82 Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
83
84 Licensed under the OpenSSL license (the "License").  You may not use
85 this file except in compliance with the License.  You can obtain a copy
86 in the file LICENSE in the source distribution or at
87 L<https://www.openssl.org/source/license.html>.
88
89 =cut