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

Name

Description

constructed

Non‐zero if the encoding uses a constructed form.

length

Number of content octets (or ‐1 for indefinite length).

tag

Tag number to encode (universal/application/context‐specific as used by callers).

Created with MrDocs