-.\" $OpenBSD: ASN1_STRING_print_ex.3,v 1.15 2019/06/06 01:06:58 schwarze Exp $
+.\" $OpenBSD: ASN1_STRING_print_ex.3,v 1.16 2021/07/06 16:05:44 schwarze Exp $
.\" full merge up to: OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
.\"
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 6 2019 $
+.Dd $Mdocdate: July 6 2021 $
.Dt ASN1_STRING_PRINT_EX 3
.Os
.Sh NAME
returns a static string.
.Sh SEE ALSO
.Xr ASN1_STRING_new 3 ,
-.Xr X509_NAME_print_ex 3
+.Xr X509_NAME_print_ex 3 ,
+.Xr X509_signature_dump 3
.Sh HISTORY
.Fn ASN1_STRING_print
first appeared in SSLeay 0.6.5 and has been available since
-.\" $OpenBSD: X509_ALGOR_dup.3,v 1.15 2021/03/12 05:18:00 jsg Exp $
+.\" $OpenBSD: X509_ALGOR_dup.3,v 1.16 2021/07/06 16:05:44 schwarze Exp $
.\" OpenSSL 4692340e Jun 7 15:49:08 2016 -0400
.\"
.\" This file is a derived work.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: March 12 2021 $
+.Dd $Mdocdate: July 6 2021 $
.Dt X509_ALGOR_DUP 3
.Os
.Sh NAME
.Xr EVP_DigestInit 3 ,
.Xr X509_get0_signature 3 ,
.Xr X509_new 3 ,
-.Xr X509_PUBKEY_get0_param 3
+.Xr X509_PUBKEY_get0_param 3 ,
+.Xr X509_signature_dump 3
.Sh STANDARDS
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and
Certificate Revocation List (CRL) Profile
-.\" $OpenBSD: X509_get0_signature.3,v 1.6 2020/06/24 19:55:55 schwarze Exp $
+.\" $OpenBSD: X509_get0_signature.3,v 1.7 2021/07/06 16:05:44 schwarze Exp $
.\" selective merge up to:
.\" OpenSSL man3/X509_get0_signature 2f7a2520 Apr 25 17:28:08 2017 +0100
.\"
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 24 2020 $
+.Dd $Mdocdate: July 6 2021 $
.Dt X509_GET0_SIGNATURE 3
.Os
.Sh NAME
.Xr X509_new 3 ,
.Xr X509_REQ_new 3 ,
.Xr X509_sign 3 ,
+.Xr X509_signature_dump 3 ,
.Xr X509_verify_cert 3
.Sh HISTORY
.Fn X509_get_signature_type
--- /dev/null
+.\" $OpenBSD: X509_signature_dump.3,v 1.1 2021/07/06 16:05:44 schwarze Exp $
+.\"
+.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: July 6 2021 $
+.Dt X509_SIGNATURE_DUMP 3
+.Os
+.Sh NAME
+.Nm X509_signature_dump ,
+.Nm X509_signature_print
+.Nd pretty-print ASN.1 strings
+.Sh SYNOPSIS
+.In openssl/x509.h
+.Ft int
+.Fo X509_signature_dump
+.Fa "BIO *bio"
+.Fa "const ASN1_STRING *signature"
+.Fa "int indent"
+.Fc
+.Ft int
+.Fo X509_signature_print
+.Fa "BIO *bio"
+.Fa "const X509_ALGOR *algorithm"
+.Fa "const ASN1_STRING *signature"
+.Fc
+.Sh DESCRIPTION
+.Fn X509_signature_dump
+writes the data bytes contained in the
+.Fa signature
+to
+.Fa bio
+in hexadecimal format with colons between bytes,
+18 bytes per output line, each line indented with
+.Fa indent
+space characters.
+.Pp
+.Fn X509_signature_print
+writes the name of the signature
+.Fa algorithm ,
+or, if no name for it is known, its object identifier (OID) to
+.Fa bio
+using
+.Xr i2a_ASN1_OBJECT 3 .
+After that, if a method object for the algorithm can be retrieved with
+.Xr EVP_PKEY_asn1_find 3
+and if that object defines a printing method, that printing method is
+used to print the
+.Fa signature .
+Otherwise, unless the
+.Fa signature
+is
+.Dv NULL ,
+it is printed using
+.Fn X509_signature_dump .
+.Sh RETURN VALUES
+These functions return 1 on success or 0 on failure.
+They fail and return as soon as any write operation fails.
+.Sh SEE ALSO
+.Xr ASN1_STRING_new 3 ,
+.Xr ASN1_STRING_print_ex 3 ,
+.Xr BIO_new 3 ,
+.Xr EVP_PKEY_asn1_new 3 ,
+.Xr X509_ALGOR_new 3 ,
+.Xr X509_get0_signature 3
+.Sh HISTORY
+.Fn X509_signature_print
+first appeared in OpenSSL 0.9.7 and has been available since
+.Ox 3.2 .
+.Pp
+.Fn X509_signature_dump
+first appeared in OpenSSL 1.0.1 and has been available since
+.Ox 5.3 .