summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/PKCS7_sign_add_signer.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-03 15:20:36 +0000
committerschwarze <>2016-11-03 15:20:36 +0000
commit60d59582dc15b87539a8dc135d2baf8a181ff37b (patch)
tree1ce08c06c8b7c83fa9592d241cddc0d7b95ce2ce /src/lib/libcrypto/man/PKCS7_sign_add_signer.3
parent05002f727738ee445b4a9367f51474995302c6a6 (diff)
downloadopenbsd-60d59582dc15b87539a8dc135d2baf8a181ff37b.tar.gz
openbsd-60d59582dc15b87539a8dc135d2baf8a181ff37b.tar.bz2
openbsd-60d59582dc15b87539a8dc135d2baf8a181ff37b.zip
convert PEM and PKCS manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/PKCS7_sign_add_signer.3')
-rw-r--r--src/lib/libcrypto/man/PKCS7_sign_add_signer.3128
1 files changed, 128 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/PKCS7_sign_add_signer.3 b/src/lib/libcrypto/man/PKCS7_sign_add_signer.3
new file mode 100644
index 0000000000..b20b6b91e6
--- /dev/null
+++ b/src/lib/libcrypto/man/PKCS7_sign_add_signer.3
@@ -0,0 +1,128 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt PKCS7_SIGN_ADD_SIGNER 3
3.Os
4.Sh NAME
5.Nm PKCS7_sign_add_signer
6.Nd add a signer PKCS7 signed data structure
7.Sh SYNOPSIS
8.In openssl/pkcs7.h
9.Ft PKCS7_SIGNER_INFO *
10.Fo PKCS7_sign_add_signer
11.Fa "PKCS7 *p7"
12.Fa "X509 *signcert"
13.Fa "EVP_PKEY *pkey"
14.Fa "const EVP_MD *md"
15.Fa "int flags"
16.Fc
17.Sh DESCRIPTION
18.Fn PKCS7_sign_add_signer
19adds a signer with certificate
20.Fa signcert
21and private key
22.Fa pkey
23using message digest
24.Fa md
25to a
26.Vt PKCS7
27signed data structure
28.Fa p7 .
29.Pp
30The
31.Vt PKCS7
32structure should be obtained from an initial call to
33.Xr PKCS7_sign 3
34with the flag
35.Dv PKCS7_PARTIAL
36set, or in the case or re-signing, a valid
37.Vt PKCS7
38signed data structure.
39.Pp
40If the
41.Fa md
42parameter is
43.Dv NULL ,
44then the default digest for the public key algorithm will be used.
45.Pp
46Unless the
47.Dv PKCS7_REUSE_DIGEST
48flag is set, the returned
49.Dv PKCS7
50structure is not complete and must be
51finalized either by streaming (if applicable) or by a call to
52.Xr PKCS7_final 3 .
53.Pp
54The main purpose of this function is to provide finer control over a
55PKCS#7 signed data structure where the simpler
56.Xr PKCS7_sign 3
57function defaults are not appropriate, for example if multiple
58signers or non default digest algorithms are needed.
59.Pp
60Any of the following flags (OR'ed together) can be passed in the
61.Fa flags
62parameter.
63.Pp
64If
65.Dv PKCS7_REUSE_DIGEST
66is set, then an attempt is made to copy the content digest value from the
67.Vt PKCS7
68structure: to add a signer to an existing structure.
69An error occurs if a matching digest value cannot be found to copy.
70The returned
71.Vt PKCS7
72structure will be valid and finalized when this flag is set.
73.Pp
74If
75.Dv PKCS7_PARTIAL
76is set in addition to
77.Dv PKCS7_REUSE_DIGEST ,
78then the
79.Dv PKCS7_SIGNER_INO
80structure will not be finalized, so additional attributes can be added.
81In this case an explicit call to
82.Xr PKCS7_SIGNER_INFO_sign 3
83is needed to finalize it.
84.Pp
85If
86.Dv PKCS7_NOCERTS
87is set, the signer's certificate will not be included in the
88.Vt PKCS7
89structure, the signer's certificate must still be supplied in the
90.Fa signcert
91parameter though.
92This can reduce the size of the signature if the signers certificate can
93be obtained by other means: for example a previously signed message.
94.Pp
95The signedData structure includes several PKCS#7 authenticatedAttributes
96including the signing time, the PKCS#7 content type and the supported
97list of ciphers in an SMIMECapabilities attribute.
98If
99.Dv PKCS7_NOATTR
100is set, then no authenticatedAttributes will be used.
101If
102.Dv PKCS7_NOSMIMECAP
103is set, then just the SMIMECapabilities are omitted.
104.Pp
105If present, the SMIMECapabilities attribute indicates support for the
106following algorithms: triple DES, 128 bit RC2, 64 bit RC2, DES and 40
107bit RC2.
108If any of these algorithms is disabled, then it will not be included.
109.Pp
110.Fn PKCS7_sign_add_signer
111returns an internal pointer to the
112.Vt PKCS7_SIGNER_INFO
113structure just added, this can be used to set additional attributes
114before it is finalized.
115.Sh RETURN VALUES
116.Fn PKCS7_sign_add_signer
117returns an internal pointer to the
118.Vt PKCS7_SIGNER_INFO
119structure just added or
120.Dv NULL
121if an error occurs.
122.Sh SEE ALSO
123.Xr ERR_get_error 3 ,
124.Xr PKCS7_final 3 ,
125.Xr PKCS7_sign 3
126.Sh HISTORY
127.Xr PKCS7_sign_add_signer 3
128was added to OpenSSL 1.0.0.