OpenBSD manual page server

Manual Page Search Parameters

ASN1_BN_PRINT(3) Library Functions Manual ASN1_BN_PRINT(3)

ASN1_bn_printpretty-print a BIGNUM object

#include <openssl/asn1.h>

ASN1_bn_print(BIO *bio_out, const char *label, const BIGNUM *bn, unsigned char *buffer, int indent);

() prints bn to bio_out in human-readable form. Despite its name and the header file, this function has nothing to do with ASN.1.

The caller is responsible for providing a buffer that is at least (bn) + 1 bytes long. To avoid a buffer overrun, be careful to not forget the “plus one”. It is unspecified what the buffer may contain after the function returns.

If indent is greater than zero, indent space characters are printed first, but not more than 128.

The NUL-terminated label is printed next.

After that, there are three cases:

Finally, a newline character is printed to end the output.

If bn is a NULL pointer, all arguments are ignored and nothing is printed.

ASN1_bn_print() returns 1 if successful or if bn is a NULL pointer. It returns 0 if printing fails.

ASN1_buf_print(3), BIO_new(3), BIO_write(3), BN_is_negative(3), BN_is_zero(3), BN_new(3), BN_num_bytes(3), BN_print(3)

ASN1_bn_print() first appeared in OpenSSL 1.0.0 and has been available since OpenBSD 4.9.

December 14, 2022 OpenBSD-7.3