add

context(der: Der)
fun <Serializable> Asn1TreeBuilder.add(serializer: KSerializer<Serializable>, value: Serializable)(source)

Encodes value with serializer and the contextual der, then appends the resulting TLV element.

If the configured DER encoding omits value, such as a nullable null when explicit nulls are disabled, nothing is appended.

Throws

SerializationException

if serialization constraints are violated


context(der: Der)
inline fun <Serializable> Asn1TreeBuilder.add(value: Serializable)(source)

Encodes value with its inferred serializer and the contextual der, then appends the resulting TLV element.

The serializer is inferred from the static type T, which must have an available kotlinx serializer.

Throws

SerializationException

if serialization constraints are violated