سؤال

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!

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top