BN_to_ASN1_INTEGER

Convert a BIGNUM to an ASN.1 INTEGER (allocating or reusing ai).

Synopsis

Declared in <openssl/asn1.h>

ASN1_INTEGER*
BN_to_ASN1_INTEGER(
    BIGNUM const* bn,
    ASN1_INTEGER* ai);

Return Value

Pointer to the INTEGER result (possibly newly allocated), or NULL on error.

Parameters

NameDescription
bnSource big integer (may be negative).
aiExisting ASN1_INTEGER to reuse, or NULL to allocate.