DerConfiguration

data class DerConfiguration(val encodeDefaults: Boolean = true, val explicitNulls: Boolean = false, val maxInputLength: Long = defaultMaxByteArrayInputLength, val maxNestingDepth: Int = DEFAULT_MAX_NESTING_DEPTH, val serializersModule: SerializersModule = EmptySerializersModule())(source)

DER format options.

Constructors

Link copied to clipboard
constructor(encodeDefaults: Boolean = true, explicitNulls: Boolean = false, maxInputLength: Long = defaultMaxByteArrayInputLength, maxNestingDepth: Int = DEFAULT_MAX_NESTING_DEPTH, serializersModule: SerializersModule = EmptySerializersModule())

Properties

Link copied to clipboard

if true, default-valued properties are encoded. If false, default-valued properties are omitted.

Link copied to clipboard

if true, nullable properties are encoded as ASN.1 NULL by default. If false, nullable null values are omitted by default. exactly as originally decoded.

Link copied to clipboard

maximum allowed DER byte-array size. Defaults to the platform's conservative array ceiling; lower it when the application or protocol has a smaller bound. Streaming Source APIs may use a tighter per-call limit.

Link copied to clipboard

maximum structural nesting depth the typed encoder/decoder will descend before throwing a kotlinx.serialization.SerializationException. The raw parser/encoder are iterative and stack-safe, but kotlinx.serialization's encode/decode contract is recursive descent (deserialize ->decodeSerializableElement ->deserialize -> ...; and the mirror on encode), so a self-referential @Serializable type that is deeply nested (decoded from deeply nested input, or serialized from a deeply nested in-memory value) would otherwise overflow the call stack with an unrecoverable StackOverflowError. A limit chosen within the runtime's actual stack headroom rejects the input with a clean, catchable exception before exhaustion. The default is 32; unusually small thread stacks may require a lower limit. Values up to 65,536 are accepted for callers that deliberately provide a larger stack; the caller is responsible for ensuring sufficient platform stack space.

Link copied to clipboard
val serializersModule: SerializersModule

serializers used for contextual/open-polymorphic resolution.