1.\" $OpenBSD: X509_signature_dump.3,v 1.1 2021/07/06 16:05:44 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 6 2021 $
18.Dt X509_SIGNATURE_DUMP 3
19.Os
20.Sh NAME
21.Nm X509_signature_dump ,
22.Nm X509_signature_print
23.Nd pretty-print ASN.1 strings
24.Sh SYNOPSIS
25.In openssl/x509.h
26.Ft int
27.Fo X509_signature_dump
28.Fa "BIO *bio"
29.Fa "const ASN1_STRING *signature"
30.Fa "int indent"
31.Fc
32.Ft int
33.Fo X509_signature_print
34.Fa "BIO *bio"
35.Fa "const X509_ALGOR *algorithm"
36.Fa "const ASN1_STRING *signature"
37.Fc
38.Sh DESCRIPTION
39.Fn X509_signature_dump
40writes the data bytes contained in the
41.Fa signature
42to
43.Fa bio
44in hexadecimal format with colons between bytes,
4518 bytes per output line, each line indented with
46.Fa indent
47space characters.
48.Pp
49.Fn X509_signature_print
50writes the name of the signature
51.Fa algorithm ,
52or, if no name for it is known, its object identifier (OID) to
53.Fa bio
54using
55.Xr i2a_ASN1_OBJECT 3 .
56After that, if a method object for the algorithm can be retrieved with
57.Xr EVP_PKEY_asn1_find 3
58and if that object defines a printing method, that printing method is
59used to print the
60.Fa signature .
61Otherwise, unless the
62.Fa signature
63is
64.Dv NULL ,
65it is printed using
66.Fn X509_signature_dump .
67.Sh RETURN VALUES
68These functions return 1 on success or 0 on failure.
69They fail and return as soon as any write operation fails.
70.Sh SEE ALSO
71.Xr ASN1_STRING_new 3 ,
72.Xr ASN1_STRING_print_ex 3 ,
73.Xr BIO_new 3 ,
74.Xr EVP_PKEY_asn1_new 3 ,
75.Xr X509_ALGOR_new 3 ,
76.Xr X509_get0_signature 3
77.Sh HISTORY
78.Fn X509_signature_print
79first appeared in OpenSSL 0.9.7 and has been available since
80.Ox 3.2 .
81.Pp
82.Fn X509_signature_dump
83first appeared in OpenSSL 1.0.1 and has been available since
84.Ox 5.3 .
85