xref: /freebsd/crypto/openssl/doc/man3/CMS_EncryptedData_set1_key.pod (revision f25b8c9fb4f58cf61adb47d7570abe7caa6d385d)
1=pod
2
3=head1 NAME
4
5CMS_EncryptedData_set1_key - Sets the cipher and key for
6CMS EncryptedData
7
8=head1 SYNOPSIS
9
10 #include <openssl/cms.h>
11
12 int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
13                                const unsigned char *key, size_t keylen);
14
15=head1 DESCRIPTION
16
17CMS_EncryptedData_set1_key() takes in a I<cms> EncryptedData object and sets
18the appropriate attributes to I<ciph>, it makes a copy of the symmetric I<key>
19of size I<keylen>. AEAD cipher algorithms are not supported.
20
21=head1 RETURN VALUES
22
23CMS_EncryptedData_set1_key() returns 0 if an error occurred otherwise
24returns 1.
25
26=head1 SEE ALSO
27
28L<CMS_EncryptedData_encrypt(3)>, L<CMS_EncryptedData_decrypt(3)>
29
30=head1 COPYRIGHT
31
32Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
33
34Licensed under the Apache License 2.0 (the "License").  You may not use
35this file except in compliance with the License.  You can obtain a copy
36in the file LICENSE in the source distribution or at
37L<https://www.openssl.org/source/license.html>.
38
39=cut
40