-- Module Example1-ASN1-Module (X.692:11/2008)
-- See also standard
-- See also the index of all ASN.1 assignments needed in this document

Example1-ASN1-Module {joint-iso-itu-t(2) asn1(1) ecn(4) examples(5)
  asn1-module1(2)} DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

MyPDU ::= CHOICE {
  married1Message       Married1,
  married2Message       Married2,
  married3Message       Married3,
  altitudeMessage       Altitude,
  evenPositiveInteger   EvenPositiveInteger,
  evenNegativeInteger   EvenNegativeInteger,
  integerWithHole       IntegerWithHole,
  positiveInteger       PositiveInteger,
  negativeInteger       NegativeInteger,
  positiveIntegerBCD    PositiveIntegerBCD,
  fax                   Fax,
  binaryFile            BinaryFile,
  password              Password,
  characterStringToBit  CharacterStringToBit,
  sequence1             Sequence1,
  sequence2             Sequence2,
  choice1               Choice1,
  choice2               Choice2
}

Married1 ::= BOOLEAN

myPDU1 MyPDU ::= married1Message:TRUE

Married2 ::= BOOLEAN

myPDU2 MyPDU ::= married2Message:FALSE

Married3 ::= BOOLEAN

myPDU3 MyPDU ::= married3Message:FALSE

Altitude ::= INTEGER(0..65535)

myPDU4 MyPDU ::= altitudeMessage:10

EvenPositiveInteger ::= INTEGER(1..MAX)(CONSTRAINED BY { -- Must be even --})

myPDU5 MyPDU ::= evenPositiveInteger:12

EvenNegativeInteger ::= INTEGER(MIN..-1)(CONSTRAINED BY { -- Must be even --})

myPDU6 MyPDU ::= evenNegativeInteger:-12

IntegerWithHole ::= INTEGER(-256..-1 | 32..1056)

myPDU7 MyPDU ::= integerWithHole:32

PositiveInteger ::= INTEGER(1..MAX)

myPDU8 MyPDU ::= positiveInteger:100

NegativeInteger ::= INTEGER(MIN..-1)

myPDU9 MyPDU ::= negativeInteger:-10

PositiveIntegerBCD ::= INTEGER(0..MAX)

myPDU10 MyPDU ::= positiveIntegerBCD:10

Fax ::=
  BIT STRING
    (CONSTRAINED BY { -- must not contain eight successive zero bits --})

myPDU11 MyPDU ::= fax:'001100110011'B

BinaryFile ::= OCTET STRING

myPDU12 MyPDU ::= binaryFile:'00010203'H

Password ::= PrintableString

myPDU13 MyPDU ::= password:"password"

CharacterStringToBit ::= IA5String("FIRST" | "SECOND" | "THIRD")

myPDU14 MyPDU ::= characterStringToBit:"SECOND"

Sequence1 ::= SEQUENCE {
  a  BOOLEAN,
  b  INTEGER OPTIONAL,
  c  BinaryFile
  -- "BinaryFile" is defined in D.1.8.1 
}

myPDU15 MyPDU ::= sequence1:{a FALSE, c '00010203'H}

Choice1 ::= CHOICE {
  boolean  [1]  BOOLEAN,
  integer  [3]  INTEGER,
  string   [5]  IA5String
}

Choice2 ::= CHOICE {
  boolean  [1]  BOOLEAN,
  integer  [3]  INTEGER,
  string   [5]  IA5String
}

myPDU16 MyPDU ::= choice1:integer:1

myPDU17 MyPDU ::= choice2:string:"string"

Sequence2 ::= SEQUENCE {a  BOOLEAN,
                        b  BIT STRING(CONTAINING Sequence3)
}

myPDU18 MyPDU ::= sequence2:{a TRUE, b CONTAINING{a 1, b TRUE}}

Sequence3 ::= SEQUENCE {a  INTEGER(0..10),
                        b  BOOLEAN
}

END
-- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D