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