Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 0c094c0
  • /
  • doc
  • /
  • internal
  • /
  • man3
  • /
  • ossl_DER_w_bn.pod
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:a5bdd848bfadf30fadbf73ef4b214ff7217432d9
directory badge Iframe embedding
swh:1:dir:b09e2df0ffd96859657d02de21a57dd3459ed871
ossl_DER_w_bn.pod
=pod

=head1 NAME

ossl_DER_w_boolean, ossl_DER_w_ulong, ossl_DER_w_bn, ossl_DER_w_null,
ossl_DER_w_octet_string, ossl_DER_w_octet_string_uint32
- internal DER writers for DER primitives

=head1 SYNOPSIS

 #include "internal/der.h"

 int ossl_DER_w_boolean(WPACKET *pkt, int tag, int b);
 int ossl_DER_w_ulong(WPACKET *pkt, int tag, unsigned long v);
 int ossl_DER_w_bn(WPACKET *pkt, int tag, const BIGNUM *v);
 int ossl_DER_w_null(WPACKET *pkt, int tag);
 int ossl_DER_w_octet_string(WPACKET *pkt, int tag,
                             const unsigned char *data, size_t data_n);
 int ossl_DER_w_octet_string_uint32(WPACKET *pkt, int tag, uint32_t value);

=head1 DESCRIPTION

All functions described here behave the same way, they prepend
(remember that DER writers are used backwards) the DER encoding of
their respective value to the already written output buffer held by
I<pkt>.

ossl_DER_w_boolean() writes the primitive BOOLEAN using the value I<b>.
Any value that evaluates as true will render a B<true> BOOLEAN,
otherwise a B<false> BOOLEAN.

ossl_DER_w_ulong() and ossl_DER_w_bn() both write the primitive INTEGER using
the value I<v>.

=for comment Other similar functions for diverse C integers should be
added.

ossl_DER_w_null() writes the primitive NULL.

ossl_DER_w_octet_string() writes the primitive OCTET STRING using the bytes
from I<data> with a length of I<data_n>.

ossl_DER_w_octet_string_uint32() writes the primitive OCTET STRING using a
32 bit value in I<value>.

=head1 RETURN VALUES

All the functions return 1 on success and 0 on failure.  Failure may
mean that the buffer held by the I<pkt> is too small, but may also
mean that the values given to the functions are invalid, such as the provided
I<tag> value being too large for the implementation.

=head1 SEE ALSO

L<DERlib(7)>

=head1 COPYRIGHT

Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top