7276e7022497c826b69cba56a42b8206a65e1baf
[openssl.git] / doc / crypto / CMS_get0_SignerInfos.pod
1 =pod
2
3 =head1 NAME
4
5 CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, CMS_SignerInfo_cert_cmp, CMS_set1_signer_certs - CMS signedData signer functions.
6
7 =head1 SYNOPSIS
8
9  #include <openssl/cms.h>
10
11  STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
12
13  int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
14                                         ASN1_OCTET_STRING **keyid,
15                                         X509_NAME **issuer, ASN1_INTEGER **sno);
16  int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
17  void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
18
19 =head1 DESCRIPTION
20
21 The function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures
22 associated with a CMS signedData structure.
23
24 CMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier
25 associated with a specific CMS_SignerInfo structure B<si>. Either the
26 keyidentifier will be set in B<keyid> or B<both> issuer name and serial number
27 in B<issuer> and B<sno>.
28
29 CMS_SignerInfo_cert_cmp() compares the cerificate B<cert> against the signer
30 identifier B<si>. It returns zero if the comparison is successful and non zero
31 if not.
32
33 CMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to
34 B<signer>.
35
36 =head1 NOTES
37
38 The main purpose of these functions is to enable an application to lookup
39 signers certificates using any appropriate technique when the simpler method
40 of CMS_verify() is not appropriate.
41
42 In typical usage and application will retrieve all CMS_SignerInfo structures
43 using CMS_get0_SignerInfo() and retrieve the identifier information using
44 CMS. It will then obtain the signer certificate by some unspecified means
45 (or return and error if it cannot be found) and set it using
46 CMS_SignerInfo_set1_signer_cert().
47
48 Once all signer certificates have been set CMS_verify() can be used.
49
50 Although CMS_get0_SignerInfos() can return NULL is an error occur B<or> if
51 there are no signers this is not a problem in practice because the only
52 error which can occur is if the B<cms> structure is not of type signedData
53 due to application error.
54
55 =head1 RETURN VALUES
56
57 CMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there
58 are no signers or an error occurs.
59
60 CMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure.
61
62 CMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non
63 zero otherwise.
64
65 CMS_SignerInfo_set1_signer_cert() does not return a value.
66
67 Any error can be obtained from L<ERR_get_error(3)|ERR_get_error(3)>
68
69 =head1 SEE ALSO
70
71 L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_verify(3)|CMS_verify(3)>
72
73 =head1 HISTORY
74
75 These functions were first was added to OpenSSL 0.9.8
76
77 =cut