Home | History | Annotate | Line # | Download | only in man3
      1  1.1  christos =pod
      2  1.1  christos 
      3  1.1  christos =head1 NAME
      4  1.1  christos 
      5  1.1  christos CMS_EncryptedData_encrypt_ex, CMS_EncryptedData_encrypt
      6  1.1  christos - Create CMS EncryptedData
      7  1.1  christos 
      8  1.1  christos =head1 SYNOPSIS
      9  1.1  christos 
     10  1.1  christos  #include <openssl/cms.h>
     11  1.1  christos 
     12  1.1  christos  CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in,
     13  1.1  christos                                                const EVP_CIPHER *cipher,
     14  1.1  christos                                                const unsigned char *key,
     15  1.1  christos                                                size_t keylen,
     16  1.1  christos                                                unsigned int flags,
     17  1.1  christos                                                OSSL_LIB_CTX *ctx,
     18  1.1  christos                                                const char *propq);
     19  1.1  christos 
     20  1.1  christos  CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in,
     21  1.1  christos      const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen,
     22  1.1  christos      unsigned int flags);
     23  1.1  christos 
     24  1.1  christos =head1 DESCRIPTION
     25  1.1  christos 
     26  1.1  christos CMS_EncryptedData_encrypt_ex() creates a B<CMS_ContentInfo> structure
     27  1.1  christos with a type B<NID_pkcs7_encrypted>. I<in> is a BIO containing the data to
     28  1.1  christos encrypt using I<cipher> and the encryption key I<key> of size I<keylen> bytes.
     29  1.1  christos The library context I<libctx> and the property query I<propq> are used when
     30  1.1  christos retrieving algorithms from providers. I<flags> is a set of optional flags.
     31  1.1  christos 
     32  1.1  christos The I<flags> field supports the options B<CMS_DETACHED>, B<CMS_STREAM> and
     33  1.1  christos B<CMS_PARTIAL>. Internally CMS_final() is called unless B<CMS_STREAM> and/or
     34  1.1  christos B<CMS_PARTIAL> is specified.
     35  1.1  christos 
     36  1.1  christos The algorithm passed in the I<cipher> parameter must support ASN1 encoding of
     37  1.1  christos its parameters.
     38  1.1  christos 
     39  1.1  christos The B<CMS_ContentInfo> structure can be freed using L<CMS_ContentInfo_free(3)>.
     40  1.1  christos 
     41  1.1  christos CMS_EncryptedData_encrypt() is similar to CMS_EncryptedData_encrypt_ex()
     42  1.1  christos but uses default values of NULL for the library context I<libctx> and the
     43  1.1  christos property query I<propq>.
     44  1.1  christos 
     45  1.1  christos =head1 RETURN VALUES
     46  1.1  christos 
     47  1.1  christos If the allocation fails, CMS_EncryptedData_encrypt_ex() and
     48  1.1  christos CMS_EncryptedData_encrypt() return NULL and set an error code that can be
     49  1.1  christos obtained by L<ERR_get_error(3)>. Otherwise they return a pointer to the newly
     50  1.1  christos allocated structure.
     51  1.1  christos 
     52  1.1  christos =head1 SEE ALSO
     53  1.1  christos 
     54  1.1  christos L<ERR_get_error(3)>, L<CMS_final(3)>, L<CMS_EncryptedData_decrypt(3)>
     55  1.1  christos 
     56  1.1  christos =head1 HISTORY
     57  1.1  christos 
     58  1.1  christos The CMS_EncryptedData_encrypt_ex() method was added in OpenSSL 3.0.
     59  1.1  christos 
     60  1.1  christos =head1 COPYRIGHT
     61  1.1  christos 
     62  1.1  christos Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
     63  1.1  christos 
     64  1.1  christos Licensed under the Apache License 2.0 (the "License").  You may not use
     65  1.1  christos this file except in compliance with the License.  You can obtain a copy
     66  1.1  christos in the file LICENSE in the source distribution or at
     67  1.1  christos L<https://www.openssl.org/source/license.html>.
     68  1.1  christos 
     69  1.1  christos =cut
     70