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