ASN.1 User-Defined Constraints

A user-defined constraint allows you to specify a set of values for a particular type. For example, a user-defined constraint can be specified to constrain a BIT STRING to a set of values produced by the encryption of a value of a specified ASN.1 type. It can be seen as a special kind of ASN.1 comment that cannot be processed automatically. User-defined constraints are introduced by the keyword "CONSTRAINED BY".

Example

DataCard ::= SEQUENCE {
        a BOOLEAN,
        b BOOLEAN,
        c INTEGER (CONSTRAINED BY { -- Must be a power of 2 --})
     }
   END

Related Topics