summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/CMS_encrypt.3
diff options
context:
space:
mode:
authorschwarze <>2016-09-05 10:43:42 +0000
committerschwarze <>2016-09-05 10:43:42 +0000
commit8bc3352bee3f743c2b8f9fd9c743fca60706336c (patch)
tree8ddbb216e39c4571145c2d202a95596f977cdfe0 /src/lib/libcrypto/man/CMS_encrypt.3
parentde12fbc1ebd942810e5ca1e55d7a6e213023f318 (diff)
downloadopenbsd-8bc3352bee3f743c2b8f9fd9c743fca60706336c.tar.gz
openbsd-8bc3352bee3f743c2b8f9fd9c743fca60706336c.tar.bz2
openbsd-8bc3352bee3f743c2b8f9fd9c743fca60706336c.zip
remove CMS manuals; beck@ agress with the general idea
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/man/CMS_encrypt.3152
1 files changed, 0 insertions, 152 deletions
diff --git a/src/lib/libcrypto/man/CMS_encrypt.3 b/src/lib/libcrypto/man/CMS_encrypt.3
deleted file mode 100644
index 5d7b0bf470..0000000000
--- a/src/lib/libcrypto/man/CMS_encrypt.3
+++ /dev/null
@@ -1,152 +0,0 @@
1.Dd $Mdocdate: November 11 2015 $
2.Dt CMS_ENCRYPT 3
3.Os
4.Sh NAME
5.Nm CMS_encrypt
6.Nd create a CMS envelopedData structure
7.Sh SYNOPSIS
8.In openssl/cms.h
9.Ft CMS_ContentInfo *
10.Fo CMS_encrypt
11.Fa "STACK_OF(X509) *certs"
12.Fa "BIO *in"
13.Fa "const EVP_CIPHER *cipher"
14.Fa "unsigned int flags"
15.Fc
16.Sh DESCRIPTION
17.Fn CMS_encrypt
18creates and returns a CMS EnvelopedData structure.
19.Fa certs
20is a list of recipient certificates.
21.Fa in
22is the content to be encrypted.
23.Fa cipher
24is the symmetric cipher to use.
25.Fa flags
26is an optional set of flags.
27.Sh NOTES
28Only certificates carrying RSA keys are supported so the recipient
29certificates supplied to this function must all contain RSA public keys,
30though they do not have to be signed using the RSA algorithm.
31.Pp
32The algorithm passed in the
33.Fa cipher
34parameter must support ASN1 encoding of its parameters.
35.Pp
36Many browsers implement a "sign and encrypt" option which is simply an
37S/MIME envelopedData containing an S/MIME signed message.
38This can be readily produced by storing the S/MIME signed message in a
39memory BIO and passing it to
40.Fn CMS_encrypt .
41.Pp
42The following flags can be passed in the
43.Fa flags
44parameter:
45.Pp
46If the
47.Dv CMS_TEXT
48flag is set, MIME headers for type
49.Sy text/plain
50are prepended to the data.
51.Pp
52Normally the supplied content is translated into MIME canonical format
53(as required by the S/MIME specifications); if
54.Dv CMS_BINARY
55is set, no translation occurs.
56This option should be used if the supplied data is in binary format;
57otherwise the translation will corrupt it.
58If
59.Dv CMS_BINARY
60is set then
61.Dv CMS_TEXT
62is ignored.
63.Pp
64OpenSSL will by default identify recipient certificates using issuer
65name and serial number.
66If
67.Dv CMS_USE_KEYID
68is set, it will use the subject key identifier value instead.
69An error occurs if all recipient certificates do not have a subject key
70identifier extension.
71.Pp
72If the
73.Dv CMS_STREAM
74flag is set, a partial
75.Vt CMS_ContentInfo
76structure is returned suitable for streaming I/O: no data is read from the
77.Vt BIO
78.Fa in .
79.Pp
80If the
81.Dv CMS_PARTIAL
82flag is set, a partial
83.Vt CMS_ContentInfo
84structure is returned to which additional recipients and attributes can
85be added before finalization.
86.Pp
87The data being encrypted is included in the
88.Vt CMS_ContentInfo
89structure, unless
90.Dv CMS_DETACHED
91is set, in which case it is omitted.
92This is rarely used in practice and is not supported by
93.Xr SMIME_write_CMS 3 .
94.Pp
95If the flag
96.Dv CMS_STREAM
97is set, the returned
98.Vt CMS_ContentInfo
99structure is
100.Em not
101complete and outputting its contents via a function that does not
102properly finalize the
103.Vt CMS_ContentInfo
104structure will give unpredictable results.
105.Pp
106Several functions including
107.Xr SMIME_write_CMS 3 ,
108.Xr i2d_CMS_bio_stream 3 ,
109.Xr PEM_write_bio_CMS_stream 3
110finalize the structure.
111Alternatively finalization can be performed by obtaining the streaming
112ASN1
113.Vt BIO
114directly using
115.Xr BIO_new_CMS 3 .
116.Pp
117The recipients specified in
118.Fa certs
119use a CMS KeyTransRecipientInfo info structure.
120KEKRecipientInfo is also supported using the flag
121.Dv CMS_PARTIAL
122and
123.Xr CMS_add0_recipient_key 3 .
124.Pp
125The parameter
126.Fa certs
127may be
128.Dv NULL
129if
130.Dv CMS_PARTIAL
131is set and recipients are added later using
132.Xr CMS_add1_recipient_cert 3
133or
134.Xr CMS_add0_recipient_key 3 .
135.Sh RETURN VALUES
136.Fn CMS_encrypt
137returns either a
138.Vt CMS_ContentInfo
139structure or
140.Dv NULL
141if an error occurred.
142The error can be obtained from
143.Xr ERR_get_error 3 .
144.Sh SEE ALSO
145.Xr CMS_decrypt 3 ,
146.Xr ERR_get_error 3
147.Sh HISTORY
148.Fn CMS_encrypt
149was added to OpenSSL 0.9.8.
150The
151.Dv CMS_STREAM
152flag was first supported in OpenSSL 1.0.0.