Deep‐copy an ASN.1 value by encoding with i2d then decoding with d2i.

Synopsis

Declared in <openssl/asn1.h>

void*
ASN1_dup(
    i2d_of_void* i2d,
    d2i_of_void* d2i,
    void const* x);

Return Value

Newly allocated copy, or NULL on error.

Parameters

Name

Description

i2d

Encoder that serializes x to DER (or returns the required length).

d2i

Decoder that rebuilds a heap object from that DER.

x

Source object to duplicate.

Created with MrDocs