Run encoding for a context and write the result into a memory buffer.
Declared in <openssl/encoder.h>
int
OSSL_ENCODER_to_data(
OSSL_ENCODER_CTX* ctx,
unsigned char** pdata,
size_t* pdata_len);
1 on success, or 0 on failure (including when a caller-supplied buffer is too small).
| Name | Description |
|---|---|
| ctx | Configured encoder context. |
| pdata | Address 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_len | On input, capacity of *pdata when non-NULL; on success, length of encoded data. Required (must not be NULL). |