ENCODER: Refactor the OSSL_ENCODER API to be more like OSSL_DECODER
[openssl.git] / doc / man3 / OSSL_ENCODER_to_bio.pod
1 =pod
2
3 =head1 NAME
4
5 OSSL_ENCODER_to_bio,
6 OSSL_ENCODER_to_fp
7 - Routines to perform an encoding
8
9 =head1 SYNOPSIS
10
11  #include <openssl/encoder.h>
12
13  int OSSL_ENCODER_to_bio(OSSL_ENCODER_CTX *ctx, BIO *out);
14  int OSSL_ENCODER_to_fp(OSSL_ENCODER_CTX *ctx, FILE *fp);
15
16 Feature availability macros:
17
18 =over 4
19
20 =item OSSL_ENCODER_to_fp() is only available when B<OPENSSL_NO_STDIO>
21 is undefined.
22
23 =back
24
25 =head1 DESCRIPTION
26
27 OSSL_ENCODER_to_bio() runs the encoding process for the context I<ctx>, with
28 the output going to the B<BIO> I<out>.  The application is required to set
29 up the B<BIO> properly, for example to have it in text or binary mode if
30 that's appropriate.
31
32 =for comment Know your encoder!
33
34 OSSL_ENCODER_to_fp() does the same thing as OSSL_ENCODER_to_bio(),
35 except that the output is going to the B<FILE> I<fp>.
36
37 =head1 RETURN VALUES
38
39 OSSL_ENCODER_to_bio() and OSSL_ENCODER_to_fp() return 1 on success, or 0 on
40 failure.
41
42 =begin comment TODO(3.0) Add examples!
43
44 =head1 EXAMPLES
45
46 Text, because pod2xxx doesn't like empty sections
47
48 =end comment
49
50 =head1 SEE ALSO
51
52 L<provider(7)>, L<OSSL_ENCODER_CTX(3)>
53
54 =head1 HISTORY
55
56 The functions described here were added in OpenSSL 3.0.
57
58 =head1 COPYRIGHT
59
60 Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
61
62 Licensed under the Apache License 2.0 (the "License").  You may not use
63 this file except in compliance with the License.  You can obtain a copy
64 in the file LICENSE in the source distribution or at
65 L<https://www.openssl.org/source/license.html>.
66
67 =cut