OpenBSD manual page server

Manual Page Search Parameters

ASN1_BUF_PRINT(3) Library Functions Manual ASN1_BUF_PRINT(3)

ASN1_buf_printpretty-print a byte array

#include <openssl/asn1.h>

ASN1_buf_print(BIO *bio_out, const unsigned char *buf, size_t buflen, int indent);

() prints a hexadecimal representation of the first buflen bytes from buf to bio_out. Despite its name and the header file, this function has nothing to do with ASN.1.

Each byte from buf is represented by two lower-case hexadecimal digits. Fifteen pairs of digits are printed per output line, or at most fifteen on the last output line. Every output line including the last one ends with a newline character. Every pair except the last is followed by a colon (‘:’). If indent is greater than zero, every output line is indented by indent space characters, but not by more than 64 characters.

ASN1_buf_print() returns 1 if successful or 0 if printing fails.

ASN1_bn_print(3), ASN1_item_print(3), ASN1_STRING_print_ex(3), ASN1_TIME_print(3), BIO_new(3), BIO_write(3)

ASN1_buf_print() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.3.

December 14, 2022 OpenBSD-7.3