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