OSSL_ENCODER_to_data

Run encoding for a context and write the result into a memory buffer.

Synopsis

Declared in <openssl/encoder.h>

int
OSSL_ENCODER_to_data(
    OSSL_ENCODER_CTX* ctx,
    unsigned char** pdata,
    size_t* pdata_len);

Return Value

1 on success, or 0 on failure (including when a caller-supplied buffer is too small).

Parameters

NameDescription
ctxConfigured encoder context.
pdataAddress of an output buffer pointer; if *pdata is NULL, a buffer is allocated with OPENSSL_malloc() and ownership transfers to the caller. If non-NULL, *pdata must point to a buffer of size *pdata_len.
pdata_lenOn input, capacity of *pdata when non-NULL; on success, length of encoded data. Required (must not be NULL).