xref: /freebsd/crypto/openssl/doc/internal/man3/ossl_DER_w_precompiled.pod (revision 9f23cbd6cae82fd77edfad7173432fa8dccd0a95)
1=pod
2
3=head1 NAME
4
5ossl_DER_w_precompiled
6- internal DER writers for precompiled DER blobs
7
8=head1 SYNOPSIS
9
10 #include "internal/der.h"
11
12 int ossl_DER_w_precompiled(WPACKET *pkt, int tag,
13                            const unsigned char *precompiled,
14                            size_t precompiled_n);
15
16=head1 DESCRIPTION
17
18There may be already existing DER blobs that can simply be copied to
19the buffer held by I<pkt>.  For example, precompiled values, such as
20OIDs (for example, C<id-sha256>) or complete AlgorithmIdentifiers
21(for example, C<sha256Identifier>).  To add those as an element in a
22structure being DER encoded, use ossl_DER_w_precompiled().
23
24ossl_DER_w_precompiled() will simply take the DER encoded blob given as
25I<precompiled> with length I<precompiled_n> and add it to the buffer
26held by I<pkt>.
27
28=head1 RETURN VALUES
29
30ossl_DER_w_precompiled() returns 1 on success and 0 on failure.  Failure
31may mean that the buffer held by the I<pkt> is too small, but may also
32mean that the values given to the functions are invalid, such as the provided
33I<tag> value being too large for the implementation.
34
35=head1 SEE ALSO
36
37L<DERlib(7)>
38
39=head1 COPYRIGHT
40
41Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
42
43Licensed under the Apache License 2.0 (the "License").  You may not use
44this file except in compliance with the License.  You can obtain a copy
45in the file LICENSE in the source distribution or at
46L<https://www.openssl.org/source/license.html>.
47
48=cut
49