Home | History | Annotate | Line # | Download | only in man3
      1 =pod
      2 
      3 =head1 NAME
      4 
      5 ossl_DER_w_boolean, ossl_DER_w_uint32, ossl_DER_w_bn, ossl_DER_w_null,
      6 ossl_DER_w_octet_string, ossl_DER_w_octet_string_uint32
      7 - internal DER writers for DER primitives
      8 
      9 =head1 SYNOPSIS
     10 
     11  #include "internal/der.h"
     12 
     13  int ossl_DER_w_boolean(WPACKET *pkt, int tag, int b);
     14  int ossl_DER_w_uint32(WPACKET *pkt, int tag, uint32_t 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);
     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 
     28 ossl_DER_w_boolean() writes the primitive BOOLEAN using the value I<b>.
     29 Any value that evaluates as true will render a B<true> BOOLEAN,
     30 otherwise a B<false> BOOLEAN.
     31 
     32 ossl_DER_w_uint32() and ossl_DER_w_bn() both write the primitive INTEGER using
     33 the value I<v>.
     34 
     35 =for comment Other similar functions for diverse C integers should be
     36 added.
     37 
     38 ossl_DER_w_null() writes the primitive NULL.
     39 
     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>.
     42 
     43 ossl_DER_w_octet_string_uint32() writes the primitive OCTET STRING using a
     44 32 bit value in I<value>.
     45 
     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
     67