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