Question

A question about the ASN.1 encoding mechanism for the primitive types. For example, I have the following type definition in test.asn1:

NodeID ::= IA5String (SIZE(1..20))

Here the NodeId can with maximum string length 20. My question was: what if the value assigned to NodeID exceeds the maximum length 20 ? Can it pass the encode function (use BER) ? Thanks!

Was it helpful?

Solution

BER doesn't take constraints into account. You could certainly have a BER encoding for an invalid NodeID, where the value violates the size constraint. Of course, your tools may prevent you from doing this, but from the perspective of ASN.1, it would be possible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top