문제

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