Value notation is used in:
It is accurate to view value references as constants. You see examples of values, as described below. Some ASN.1 toolkits make little or no use of value notation, while others use them to their fullest to make life easier for you.
For example, the OSS ASN.1 Tools uses default values to determine whether it should encode a value when the Distinguished Encoding Rules are in use, because DER stipulates that default values should never be transmitted. Also, upon returning from ossDecode(), if a value of a given field was not present in the encoding and a default value was defined for it, then the default value is returned to your program as if it were present in the encoding.
The OSS ASN.1 Tools uses values specified in subtype constraints to enforce strong constraint checking at runtime (unless you elect to disable this feature.) For example, for an INTEGER type defined to carry values 7, 10 and 20-33, the OSS encoder/decoder will complain if the value is not one of these.
The OSS ASN.1 Tools uses values specified in information object set definitions to allow it to enforce component relation constraints (restrictions imposed on one field based on the value of another field) and to automatically encode or decode nested open type values via a single call to the encoder or decoder, if you elect to use this feature.
When the -test option of the OSS ASN.1 Compiler is specified it causes the compiler to generate a complete program to encode, decode, print, etc. values defined via value assignments. The value is encoded in BER, PER and DER, and printed in value notation and hex formats. This makes it easy for you to see what the encodings might look like in the various encoding rules without your having to write a program to encode and print the values.
The samples included with some of the Knowledge Center answers are meant for your general understanding of the OSS products. Different versions of the products might produce slightly different outputs. Consult the products documentation and samples for the most up-to-date products information and code examples.
Test drive the OSS Nokalva ASN.1, LTE, and XML Tools now! Your trial includes complete software, documentation, sample programs, free 24x7 technical support and more.
Our expert personnel can help you learn ASN.1!
We offer 4-day ASN.1 courses at our headquarters or your premises.