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_compress - create a CMS CompressedData structure
      6      1.1  christos 
      7      1.1  christos =head1 SYNOPSIS
      8      1.1  christos 
      9      1.1  christos  #include <openssl/cms.h>
     10      1.1  christos 
     11      1.1  christos  CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
     12      1.1  christos 
     13      1.1  christos =head1 DESCRIPTION
     14      1.1  christos 
     15      1.1  christos CMS_compress() creates and returns a CMS CompressedData structure. B<comp_nid>
     16      1.1  christos is the compression algorithm to use or B<NID_undef> to use the default
     17      1.1  christos algorithm (zlib compression). B<in> is the content to be compressed.
     18      1.1  christos B<flags> is an optional set of flags.
     19      1.1  christos 
     20      1.1  christos The only currently supported compression algorithm is zlib using the NID
     21      1.1  christos NID_zlib_compression.
     22      1.1  christos 
     23      1.1  christos If zlib support is not compiled into OpenSSL then CMS_compress() will return
     24      1.1  christos an error.
     25      1.1  christos 
     26      1.1  christos If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are
     27      1.1  christos prepended to the data.
     28      1.1  christos 
     29      1.1  christos Normally the supplied content is translated into MIME canonical format (as
     30      1.1  christos required by the S/MIME specifications) if B<CMS_BINARY> is set no translation
     31      1.1  christos occurs. This option should be used if the supplied data is in binary format
     32      1.1  christos otherwise the translation will corrupt it. If B<CMS_BINARY> is set then
     33      1.1  christos B<CMS_TEXT> is ignored.
     34      1.1  christos 
     35      1.1  christos If the B<CMS_STREAM> flag is set a partial B<CMS_ContentInfo> structure is
     36      1.1  christos returned suitable for streaming I/O: no data is read from the BIO B<in>.
     37      1.1  christos 
     38      1.1  christos The compressed data is included in the CMS_ContentInfo structure, unless
     39      1.1  christos B<CMS_DETACHED> is set in which case it is omitted. This is rarely used in
     40      1.1  christos practice and is not supported by SMIME_write_CMS().
     41      1.1  christos 
     42      1.1  christos If the flag B<CMS_STREAM> is set the returned B<CMS_ContentInfo> structure is
     43      1.1  christos B<not> complete and outputting its contents via a function that does not
     44      1.1  christos properly finalize the B<CMS_ContentInfo> structure will give unpredictable
     45      1.1  christos results.
     46      1.1  christos 
     47      1.1  christos Several functions including SMIME_write_CMS(), i2d_CMS_bio_stream(),
     48      1.1  christos PEM_write_bio_CMS_stream() finalize the structure. Alternatively finalization
     49      1.1  christos can be performed by obtaining the streaming ASN1 B<BIO> directly using
     50      1.1  christos BIO_new_CMS().
     51      1.1  christos 
     52      1.1  christos Additional compression parameters such as the zlib compression level cannot
     53      1.1  christos currently be set.
     54      1.1  christos 
     55      1.1  christos =head1 RETURN VALUES
     56      1.1  christos 
     57      1.1  christos CMS_compress() returns either a CMS_ContentInfo structure or NULL if an error
     58      1.1  christos occurred. The error can be obtained from ERR_get_error(3).
     59      1.1  christos 
     60      1.1  christos =head1 SEE ALSO
     61      1.1  christos 
     62      1.1  christos L<ERR_get_error(3)>, L<CMS_uncompress(3)>
     63      1.1  christos 
     64      1.1  christos =head1 HISTORY
     65      1.1  christos 
     66      1.1  christos The B<CMS_STREAM> flag was added in OpenSSL 1.0.0.
     67      1.1  christos 
     68      1.1  christos =head1 COPYRIGHT
     69      1.1  christos 
     70      1.1  christos Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
     71      1.1  christos 
     72  1.1.1.2  christos Licensed under the Apache License 2.0 (the "License").  You may not use
     73      1.1  christos this file except in compliance with the License.  You can obtain a copy
     74      1.1  christos in the file LICENSE in the source distribution or at
     75      1.1  christos L<https://www.openssl.org/source/license.html>.
     76      1.1  christos 
     77      1.1  christos =cut
     78