c51223f71a03ebf6bb92cb66d71a0d4fa87866f5
[openssl.git] / doc / internal / man3 / DER_w_bn.pod
1 =pod
2
3 =head1 NAME
4
5 DER_w_boolean, DER_w_ulong, DER_w_bn, DER_w_null
6 - internal DER writers for DER primitives
7
8 =head1 SYNOPSIS
9
10  #include "internal/der.h"
11
12  int DER_w_boolean(WPACKET *pkt, int tag, int b);
13  int DER_w_ulong(WPACKET *pkt, int tag, unsigned long v);
14  int DER_w_bn(WPACKET *pkt, int tag, const BIGNUM *v);
15  int DER_w_null(WPACKET *pkt, int tag);
16
17 =head1 DESCRIPTION
18
19 All functions described here behave the same way, they prepend
20 (remember that DER writers are used backwards) the DER encoding of
21 their respective value to the already written output buffer held by
22 I<pkt>.
23
24 DER_w_boolean() writes the primitive BOOLEAN using the value I<b>.
25 Any value that evaluates as true will render a B<true> BOOLEAN,
26 otherwise a B<false> BOOLEAN.
27
28 DER_w_ulong() and DER_w_bn() both write the primitive INTEGER using
29 the value I<v>.
30
31 =for comment Other similar functions for diverse C integers should be
32 added.
33
34 DER_w_null() writes the primitive NULL.
35
36 =head1 RETURN VALUES
37
38 All the functions return 1 on success and 0 on failure.  Failure may
39 mean that the buffer held by the I<pkt> is too small, but may also
40 mean that the values given to the functions are invalid, such as the provided
41 I<tag> value being too large for the implementation.
42
43 =head1 SEE ALSO
44
45 L<DERlib(7)>
46
47 =head1 COPYRIGHT
48
49 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
50
51 Licensed under the Apache License 2.0 (the "License").  You may not use
52 this file except in compliance with the License.  You can obtain a copy
53 in the file LICENSE in the source distribution or at
54 L<https://www.openssl.org/source/license.html>.
55
56 =cut