Add ASN1_item_i2d_mem_bio(); document and improve also ASN1_item_d2i_bio()
[openssl.git] / doc / man3 / ASN1_item_d2i_bio.pod
1 =pod
2
3 =head1 NAME
4
5 ASN1_item_d2i_bio,
6 ASN1_item_i2d_mem_bio
7 - decode and encode DER-encoded ASN.1 structures
8
9 =head1 SYNOPSIS
10
11  #include <openssl/asn1.h>
12
13  void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval);
14  BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
15
16 =head1 DESCRIPTION
17
18 ASN1_item_d2i_bio() decodes the contents of its input BIO I<in>,
19 which must be a DER-encoded ASN.1 structure, using the ASN.1 template I<it>
20 and places the result in I<*pval> unless I<pval> is NULL.
21 If I<in> is NULL it returns NULL, else a pointer to the parsed structure.
22
23 ASN1_item_i2d_mem_bio() encodes the given ASN.1 value I<val>
24 using the ASN.1 template I<it> and returns the result in a memory BIO.
25
26 =head1 RETURN VALUES
27
28 ASN1_item_d2i_bio() returns a pointer to an B<ASN1_VALUE> or NULL.
29
30 ASN1_item_i2d_mem_bio() returns a pointer to a memory BIO or NULL on error.
31
32 =head1 HISTORY
33
34 The functions described here were added in OpenSSL 3.0.
35
36 =head1 COPYRIGHT
37
38 Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
39
40 Licensed under the Apache License 2.0 (the "License").  You may not use
41 this file except in compliance with the License.  You can obtain a copy
42 in the file LICENSE in the source distribution or at
43 L<https://www.openssl.org/source/license.html>.
44
45 =cut