]>
Commit | Line | Data |
---|---|---|
1d39620b RL |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
a55b00bd P |
5 | ossl_DER_w_boolean, ossl_DER_w_ulong, ossl_DER_w_bn, ossl_DER_w_null, |
6 | ossl_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 | ||
23 | All functions described here behave the same way, they prepend | |
24 | (remember that DER writers are used backwards) the DER encoding of | |
25 | their respective value to the already written output buffer held by | |
26 | I<pkt>. | |
27 | ||
a55b00bd | 28 | ossl_DER_w_boolean() writes the primitive BOOLEAN using the value I<b>. |
1d39620b RL |
29 | Any value that evaluates as true will render a B<true> BOOLEAN, |
30 | otherwise a B<false> BOOLEAN. | |
31 | ||
a55b00bd | 32 | ossl_DER_w_ulong() and ossl_DER_w_bn() both write the primitive INTEGER using |
1d39620b RL |
33 | the value I<v>. |
34 | ||
35 | =for comment Other similar functions for diverse C integers should be | |
36 | added. | |
37 | ||
a55b00bd | 38 | ossl_DER_w_null() writes the primitive NULL. |
1d39620b | 39 | |
a55b00bd P |
40 | ossl_DER_w_octet_string() writes the primitive OCTET STRING using the bytes |
41 | from I<data> with a length of I<data_n>. | |
e5b2cd58 | 42 | |
a55b00bd P |
43 | ossl_DER_w_octet_string_uint32() writes the primitive OCTET STRING using a |
44 | 32 bit value in I<value>. | |
e5b2cd58 | 45 | |
1d39620b RL |
46 | =head1 RETURN VALUES |
47 | ||
48 | All the functions return 1 on success and 0 on failure. Failure may | |
49 | mean that the buffer held by the I<pkt> is too small, but may also | |
50 | mean that the values given to the functions are invalid, such as the provided | |
51 | I<tag> value being too large for the implementation. | |
52 | ||
53 | =head1 SEE ALSO | |
54 | ||
55 | L<DERlib(7)> | |
56 | ||
57 | =head1 COPYRIGHT | |
58 | ||
59 | Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. | |
60 | ||
61 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
62 | this file except in compliance with the License. You can obtain a copy | |
63 | in the file LICENSE in the source distribution or at | |
64 | L<https://www.openssl.org/source/license.html>. | |
65 | ||
66 | =cut |