ASN1_object_size

Compute the total DER size of a tagged ASN.1 value given its content length.

Synopsis

Declared in <openssl/asn1.h>

int
ASN1_object_size(
    int constructed,
    int length,
    int tag);

Return Value

Total number of octets for tag, length, and content, or a negative value on error.

Parameters

NameDescription
constructedNon-zero if the encoding uses a constructed form.
lengthNumber of content octets (or -1 for indefinite length).
tagTag number to encode (universal/application/context-specific as used by callers).