TOP

ASN-1Step Command-line Options Reference

Applies to: ASN-1Step 8.2

-1990 | -2015

Specifies the ASN.1 version used in the input ASN.1 specification file.

The -1990 option indicates that the ASN.1 specification conforms only to the 1990 version of ASN.1. ASN-1Step fully supports ASN.1:1990, including these features:

  • Macro notation
  • ANY DEFINED BY
  • Named types without identifiers

The -2015 option indicates that the ASN.1 specification conforms to the 2015 version of ASN.1. ASN-1Step fully supports ASN.1:2015, including these features:

  • Automatic tagging
  • Information object classes
  • Component relation constraints
  • Table constraints
  • User-defined constraints
  • Parameterization
  • Version brackets
  • Enhanced subtype notation capabilities
  • TIME, OID-IRI, and RELATIVE-OID-IRI types

Remarks

ASN-1Step lets you mix the 1990 and 2015 syntaxes, but issues warnings since this behavior is not allowed by X.680 (2015) ISO/IEC 8824-1:2015.

When using ASN.1:2015 syntax, ASN-1Step complains when:

  • Components of a SET, SEQUENCE, or CHOICE do not have an identifier.
  • A colon (":") is absent from an open type or CHOICE value.
  • A value reference (defined value) appears before the DEFINITIONS keyword that signals the start of an ASN.1 module or appears within an object identifier used to define an ASN.1 module.

The -1993, -1994, -1997, -2002, and -2008 compiler options are equivalent to the -2015 option.

Default Behavior

ASN-1Step starts out in neutral mode, expecting either ASN.1 version. Once syntax unique to ASN.1:1990 or ASN.1:2015 is detected, ASN-1Step exits neutral mode and checks for conformance to the detected version, generating messages for any violations. However, starting in neutral mode could cause a longer ASN.1 specification debugging cycle, especially when creating new ASN.1 specifications.

↩Options Index


-allEncode

This option instructs ASN-1Step to encode all value references specified in the input ASN.1 specification. It works as if the -encodeValue option, with one or more encoding rule options, was specified for each value reference in the input notation.

When the -output option is not specified, each value reference is encoded using the specified encoding rules. The output filenames will have prefixes derived from the value reference names and extensions derived from the encoding rules. This is similar to how the -encodeValue option works.

When the -output <prefix> option is specified, one file is created for each encoding rule, with concatenated messages for all values. The filename prefix matches the prefix specified in the option and the file extension is derived from the encoding rule. If the -concatenate is also specified and the output file already exists, the new records are concatenated to the content of the output file. In this case, the concatenated records must belong to the same PDU. Otherwise, if records were created using PER or if the syntax has PDUs with non-unique tags, the decoder cannot automatically decode all concatenated messages from such a file.

Default Behavior

The -allEncode option is turned off.

↩Options Index


-allow BadCase

This option instructs ASN-1Step to accept input syntax that deviates from the standard, as specified by the argument. Use with caution and only when absolutely necessary.

The option takes a single argument, but can be specified more than once when multiple arguments are needed, for example:

asn1step foo.asn -allow BadValues -allow UniversalTags 

Arguments

-allow BadExplicitAutomaticTagging

Instructs ASN-1Step to use explicit automatic tagging not only for untagged but also for tagged CHOICE types, open types, and "DummyReference" types, based on the interpretation of clause 31.2.7 c of the X.680 2002 ASN.1 standard.

In the following example, if -allow BadExplicitAutomaticTagging is specified, ASN-1Step uses explicit automatic tagging for the ch field that has the tagged CHOICE type. If -allow BadExplicitAutomaticTagging is not specified, ASN-1Step uses implicit tagging for this field.

B4114 DEFINITIONS AUTOMATIC TAGS ::= BEGIN
   Seq ::= [65] SEQUENCE { ch Cho }
   Cho ::= [65] CHOICE { b BOOLEAN }
   s Seq ::= { ch b : TRUE }
END
-allow BadValues

This option is implied by the default -relaxedMode option and instructs ASN-1Step to continue the current process when a content error is found in the value notation of restricted character strings (i.e., NumericString, PrintableString, and VisibleString), OBJECT IDENTIFIERs, or extensible types with missing mandatory extension additions.

Example
myPhoneNumber   NumericString      ::= "(800) 555-1212 EXT-6"
myObjectID      OBJECT IDENTIFIER  ::= {0 26}

This value notation will cause ASN-1Step to exit with an error message, unless –allow BadValues is specified.
According to the ASN.1 standard, the NumericString type allows only numbers (0-9) and white space in its contents. The OBJECT IDENTIFIER type allows no value larger than 4 for its second node.

Remarks

ASN-1Step does not truncate BIT STRING, restricted string, or OCTET STRING values defined with extensible size constraints when the UNBOUNDED or NULLTERM representation is used. Nor will it truncate SEQUENCE OF or SET OF types.

To instruct ASN-1Step to treat the errors as warnings, use the -ignoreError option.

This option also instructs ASN-1Step to issue the A1007W warning message, instead of the A1006E error message in some cases of type-value mismatch in ENUMERATED, SET, SEQUENCE, or CHOICE value assignments. For ENUMERATED types, differences in the named values set are allowed. For SET, SEQUENCE, and CHOICE types, differences in field tags and in the extension marker position are allowed.

See Also

-allow MixedCaseForSomeBuiltInTypesNames

This option is implied by the default -relaxedMode option. It instructs ASN-1Step to accept mixed-case names for some ASN.1 built-in types, provided that types with these names are not already defined in the ASN.1 input.

This option currently supports mixed-case names for these built-in types:

  • INTEGER without named numbers
  • BOOLEAN
  • NULL
  • Restricted character string: UTF8String, NumericString, PrintableString, TeletexString, T61String, VideotexString, IA5String, GraphicString, VisibleString, ISO646String, GeneralString, UniversalString, BMPString
  • Time: TIME, DATE, TIME-OF-DAY, DATE-TIME, DURATION
  • GeneralizedTime and UTCTime
Example
M DEFINITIONS ::=  BEGIN
 Type ::= IA5STRING
 value Type ::= "abc"
END

This is normally an invalid ASN.1 syntax since 'IA5STRING' is used but is not defined.

If -allow MixedCaseForSomeBuiltInTypesNames is not specified the compiler reports the following errors:

"test.asn", line 2 (M): A0256W: 'IA5STRING' is referenced, but is not defined.
"test.asn", line 2 (M): A0052E: 'IA5STRING' is not defined.

The -allow MixedCaseForSomeBuiltInTypesNames option allows you to compile such ASN.1 syntax; the compiler will assume that the 'IA5STRING' is a misspelling of the built-in type 'IA5String':

"test.asn", line 2 (M): A1277W: 'IA5STRING' is assumed to be a misspelling of the built-in type 'IA5String'.
-allow UnderscoresInAsn1Names

This option is implied by the default -relaxedMode option. It instructs ASN-1Step to accept ASN.1 names that contain the underscore character ("_") after the initial character.

Example
M DEFINITIONS ::= BEGIN
  Some_Type ::= INTEGER
END

If -allow UnderscoresInAsn1Names is not specified ASN-1Step reports the following errors:

"test.asn", line 2 (M): A1271E: The low line character ('_') is not among the permitted characters for ASN.1 names. 
Please use the '-allow UnderscoresInAsn1Names' command line option to force the compiler to accept such invalid names.
  Some_Type ::= INTEGER
      ^

"test.asn", line 2 (M): A0120E: Parsing error: expecting '::=', '{' or an ASN.1 Type but found illegal character.
  Some_Type ::= INTEGER
      ^
-allow UniversalTags

Instructs ASN-1Step to accept UNIVERSAL class tags that are normally prohibited. This option is enabled by default in trial versions of ASN-1Step.

Use UNIVERSAL class tags for

  • IMPLICIT tags whose number matches a built-in type tag.
  • CHARACTER STRING and OCTET STRING types with a specified tag number that matches one of the restricted character string types.

Any other UNIVERSAL tags are rejected.

Example

If you use a UNIVERSAL tag for a CHARACTER STRING or OCTET STRING type, ASN-1Step will redefine the type to a restricted character string type according to its tag number.

M DEFINITIONS IMPLICIT TAGS ::= BEGIN
        B-ignore ::= [UNIVERSAL 1] IMPLICIT BOOLEAN

        CS-ignore ::= [UNIVERSAL 29] CHARACTER STRING
        OS-ignore ::= [UNIVERSAL 4] OCTET STRING

        GT-ignore ::= [UNIVERSAL 24] GeneralizedTime
        UTCT-ignore ::= [UNIVERSAL 23] UTCTime
        U8-ignore ::= [UNIVERSAL 12] UTF8String
        BMP-ignore ::= [UNIVERSAL 30] BMPString

        CS-U8 ::= [UNIVERSAL 12] CHARACTER STRING
        OS-U8 ::= [UNIVERSAL 12] OCTET STRING

        CS-BMP ::= [UNIVERSAL 30] CHARACTER STRING
        OS-BMP ::= [UNIVERSAL 30] OCTET STRING  
END

In this example, the CS-U8 type is treated as a UTF8String. Following is one of the warning messages issued:

"test.asn", line 2 (M): A0307W: OSS has relaxed the standards to allow the definition of a type with tag [UNIVERSAL 1].
 This is normally invalid ASN.1.  The tag will be ignored.
        B-ignore ::= [UNIVERSAL 1] IMPLICIT BOOLEAN
                                 ^

Default Behavior

The –allow UniversalTags option is turned off.

See Also

↩Options Index


-allSampleAsn1Values | -sampleAsn1Value

These options instruct ASN-1Step to create sample values in ASN.1 value notation format for PDU types present in the ASN.1 input. The options have the following syntax:

-allSampleAsn1Values [[<flags>][,<outFileName>]]
-sampleAsn1Value <pduTypeName>[,[<flags>][,<outFileName>]]
  • The -allSampleAsn1Values option instructs the compiler to create sample values for all PDU types present in the ASN.1 input, except for artificial PDU types created for types in the "ContentsConstraint" and PDU types created by the use of component relation constraints.
  • The -sampleAsn1Value option instructs the compiler to create a sample value for the particular PDU type specified by the <pduTypeName> parameter.

By default, the ASN.1 value listing created with these options is printed to stdout. You can change this behavior using the optional <flags> and <outFileName> parameters.

The <flags> parameter is one or two of the following flags, separated by colons:

  • FILE - print the ASN.1 value listing into an <outputprefix>-samplevalues.asn file, where <outputprefix> is the last input .asn file prefix.
  • MOD - print values inside a module definition.

The <outFileName> parameter specifies the output file name to be used for ASN.1 value listing, the parameter is ignored if the FILE flag is specified in <flags>.

Consider the following ASN.1 example (bcas.asn):

Bcas DEFINITIONS ::= BEGIN

    BBCard ::= SEQUENCE {
        name IA5String (SIZE (1..60)),
        team IA5String (SIZE (1..60)),
        age INTEGER (1..100),
        position IA5String (SIZE (1..60)),
        handedness ENUMERATED {left-handed(0), right-handed(1), ambidextrous(2)},
        batting-average REAL
    }

 END

Issue the following command:

asn1step bcas.asn -allSampleAsn1Values

After execution, you should see output similar to the following:

ASN1STEP: Creating sample values for all PDU types

    samplevalue-BBCard Bcas.BBCard ::= {
        name            "name",
        team            "team",
        age             1,
        position        "position",
        handedness      left-handed,
        batting-average 0
    }

    C0043I: 0 error messages, 0 warning messages and 0 informatory messages issued.

This command

asn1step bcas.asn -sampleAsn1Value BBCard,FILE:MOD

will create the bcas-samplevalues.asn file with the following content:

OSS-SAMPLE-VALUES-MODULE
    DEFINITIONS ::=
    BEGIN
    IMPORTS
        BBCard
        FROM Bcas;

    samplevalue-BBCard BBCard ::= {
        name            "name",
        team            "team",
        age             1,
        position        "position",
        handedness      left-handed,
        batting-average 0
    }

    END

This command:

asn1step bcas.asn -sampleAsn1Value BBCard,MOD,myBcasValues.asn

will create the myBcasValues.asn file with the same content as in the bcas-samplevalues.asn from the previous example.

Default Behavior

These options are turned off.

↩Options Index


-asn1Value

Instructs ASN-1Step to generate ASN.1 value notation for an input encoded message when the -decodePdu option is used or implied.

The output ASN.1 value notation is placed in a text file whose name, by default, is based on the corresponding input encoding file (e.g., myValue.ber.txt for an input encoding file named myValue.ber). Use the -output option to specify a different name for the text file.

Example

asn1step bcas.asn -decodePdu BBCard bcas.ber -asn1value

In the above example, the input BER-encoded value stored in the bcas.ber file will be decoded and the corresponding ASN.1 value will be written to the bcas.ber.txt file. If several input files with encoded values are specified along with the -decode, -asn1Value, or -output options, all values are added to one text file with the same prefix as the -output option parameter, with the .txt extension. If the -concatenate option is also specified and the output file already exists, the new ASN.1 values are appended to the end of the existing text file.

Default Behavior

The –asn1Value option is turned off.

↩Options Index


-assignments

Instructs ASN-1Step to process type and value assignments found outside defined input modules.

Example

 Module1 DEFINITIONS ::= BEGIN
    MyInt ::= INTEGER
 END

    ExtraModularType ::= INTEGER

 Module2 DEFINITIONS ::= BEGIN
    MyBit ::= INTEGER
 END
  

If the -assignments option is not specified, ASN-1Step issues an error because ExtraModularType is outside of a BEGIN-END ASN.1 module.

Default Behavior

The –assignments option is turned off.

↩Options Index


-autoEncDec

Allows automatic encoding and decoding of open types when constraint checking is disabled (-noConstraints).

Default Behavior

The –autoEncDec option is turned off.

See Also

↩Options Index


-binCharacters [numGroupChars]

Specifies that BER, DER, PER Aligned or Unaligned, OER, or C-OER encoded data should be read/written to a text file containing binary characters (i.e., '0's and '1's). For example, the following command issued for samples/sample.asn:

asn1step sample.asn sample.ber -bin -encodeValue myName

will produce a text file named sample.ber that contains:

00010110 00000011 01001111 01010011 01010011

The optional numGroupChars argument specifies the number of '0's and '1's that should be printed before a white space is inserted. By default, numGroupChars has a value of 8.

Remarks

ASN-1Step writes the output encoded data to a binary file and expects the input encoded data to be contained within a binary file.

Default Behavior

The –autoEncDec option is turned off.

See Also

↩Options Index


-commandFile commandFileName

Specifies the name of the text-file containing command-line options for the current invocation of ASN-1Step. This option is useful on systems that do not permit long command lines or do not support command-line continuation characters. Options contained in the file are treated as if they were entered on the command line. The file can consist of several lines; ASN-1Step will read all of them.

Example

The following command invokes ASN-1Step using the command-line tokens contained in the tenLinesOfOptions.opt text file :

asn1step -commandFile tenLinesOfOptions.opt

Remarks

Command files can contain comments. The "--" characters specify the beginning of a comment. They can be placed anywhere on the line. The comment continues until a subsequent "--" is reached or the line ends.

Default Behavior

The -commandFile option is turned off.

↩Options Index


-concatenate

Can be used along with the -output option to instruct ASN-1Step to preserve the content of the output file, if it exists. New records will be added to the end of the existing output file when this option is specified.

Default Behavior

The -concatenate option is turned off.

↩Options Index


-constraints | -noConstraints

The -constraints option instructs ASN-1Step to check constraints.

The -noConstraints option specifies that no constraint checking is done, which results in a slightly faster execution.

Default Behavior

The -constraints option is turned on.

↩Options Index


-csv flags

Instructs the compiler to convert ASN.1 to or from the Comma-Separated Value (CSV) format. The -csv option can be used with the -allEncode, –encodeValue, -decodePDU, or –test option. You can specify one or more comma-separated flags immediately after the option.

Examples

In the following example, -csv is used with –encodeValue. The myCard ASN.1 value is encoded as myCard.csv using CSV column format. OCTET STRING type values without the OSS.PrintFunctionName directive and an OSS conversion function are converted to TBCD. The '=' character is a column separator, and extra CSVs are created for a maximum of 3 components from each SET OF and SEQUENCE OF value.

asn1step bcas.asn -encodeValue myCard –csv tbcd,column,=,3

In the next example, -csv is used with –decodePDU. The input value encoded in CSV is stored in the myCard.csv file, which is decoded using the ascii, noheader, ':' flags. The flags assume that the CSV has a row format, the header is absent, and ':' is used as a column separator. OCTET STRING type values are converted from ASCII to the internal format if they do not have the OSS.PrintFunctionName directive with an OSS conversion function.

asn1step bcas.asn -decodePDU BBCard myCard.csv –csv nohead,ascii,':'

When decoding succeeds, CSVs will not be re-encoded with the same flags. Conversely, when decoding is successful using BER, PER, or other encoding rules, re-encoding is performed.

When decoding fails, ASN-1Step attempts to determine the format of the input .csv file and decode it. If this decoding succeeds, then the .csv file is re-encoded using the flags from the –csv option to create the output myCard.csv file. If it fails, the error from the first decoding is re-issued.

For OCTET STRING type values that do not have the OSS.PrintFunctionName directive with an OSS conversion function, you can select the ASCII, BCD, or TBCD format.

OSS conversion functions

  • ossPrintOctetAsBCDString
  • ossPrintOctetAsTBCDString
  • ossPrintOctetAsASCII
  • ossPrintOctetAsIPAddress
  • ossPrintOctetAsTimeStamp

When the OCTET STRING type values have the OSS.PrintFunctionName directive containing an OSS conversion function as a parameter in the input ASN.1 syntax, then the values are always converted to the format related to the function name: BCD, TBCD, ASCII, IP address, or a time stamp format.

Flags used to parse CSV input and to create CSV output

Flag names can be truncated.

CSV Flag Description
ascii Converts values of OCTET STRING types (that do not have OSS.PrintFunctionName directives with an OSS conversion function) from ASCII when decoding input CSVs and to ASCII when creating output CSVs.
column Indicates that the input or output CSVs are placed on a separate line, possibly following an optional CSV header name and a column separator.
bcd Converts OCTET STRING type values (that do not have the OSS.PrintFunctionName directive with an OSS conversion function) to or from BCD.
dashes Converts GeneralizedTime type values and values of OCTET STRING types that have the OSS.PrintFunctionName directive with the ossPrintOctetAsTimeStamp parameter to or from the following time stamp format: YYYY-MM-DD HH:MM:SS. Example: 2007-11-07 11:36:49
digit Prints BOOLEAN and ENUMERATED type values as their related integers.
noauto Indicates that open type values are not automatically decoded. If the XER encoding rules are available, open type values are printed in XML. Otherwise, the first available encoding rules are used to handle open type values, either in XML or in hexadecimal format (for binary encoding rules).
noheader Indicates that the CSV header is absent.
pduname Indicates that the header name in the first column has the PDU name prefix.
singlenames Indicates that the CSV header includes single field names for the innermost simple types.
slashes Converts GeneralizedTime type values and values of OCTET STRING types that have the OSS.PrintFunctionName directive with the ossPrintOctetAsTimeStamp parameter to or from the following time stamp format: MM/DD/YY HH:MM:SS. Example: 06/01/00 11:36:49
spaces Indicates that column separators may have surrounding spaces in the input CSV. Also, when converting to CSV, an extra space character is added before and after the column separator.
tbcd Converts OCTET STRING type values (that do not have the OSS.PrintFunctionName directive with an OSS conversion function) to or from TBCD.
text Indicates that the input or output CSV is a null-terminated string in which Unicode characters are represented as UTF-8 encodings in text format using \x##, a special C-style character sequence.
<number> Identifies the maximum number of components of each SET OF and SEQUENCE OF type values for which an extra CSV should be created. To avoid significant performance degradation, the number is limited to 50. The total number of additional CSVs for each SET OF and SEQUENCE OF type is limited to 50.
':' Is used as a column separator.
'=' Is used as a column separator.
';' Is used as a column separator for Windows platforms.

When -csv is specified without parameters, the following flags are used by default to create CSVs:

  • The row format is used with the comma separator without surrounding spaces.
  • The full header is used with absolute references for all fields and special PDU names or numbers inside parentheses for open type values. The underscore character is used as a name separator, for example, field1_field2_field3.
  • FALSE and TRUE values are used for BOOLEAN types.
  • Identifiers are printed for ENUMERATED types.
  • Open type values are automatically decoded.
  • OCTET STRING type values (that do not have the OSS.PrintFunctionName directive with an OSS conversion function) are printed as xmlhstrings.
  • Additional CSVs are created for up to 50 components from values of each SET OF and SEQUENCE OF type.

Example

ASN.1:

     PersonnelRecord ::= SEQUENCE {
             name     PrintableString,
             number   INTEGER OPTIONAL,
             status   BOOLEAN,
             children SEQUENCE OF ChildInformation
     }
     ChildInformation ::= SET {
             name    PrintableString,
             gender  ENUMERATED {girl(0), boy(1)},
             time    GeneralizedTime OPTIONAL
     }

     value PersonnelRecord ::= {
             name "Nancy",
             number 201,
             status TRUE,
             children {
                     {name "James", gender boy, time  "20020312123517"},
                     {name "Martha", gender girl, time "20100820045240"}
             }
     }

Command line:

     asn1step csvtest.asn –encode value -csv 

CSV:

     name,number,status,children_name,children_gender,children_time
     "Nancy",201,TRUE,"James",boy,20020312123517.000
     "Nancy",201,TRUE,"Martha",girl,20100820045240.000

Command line:

     asn1step csvtest –encode value –csv 1,=,column,spaces,dashes,pduname 

CSV:

     PersonnelRecord_name = "Nancy"
     number = 201
     status = TRUE
     children_name = "James"
     children_gender = boy
     children_time = 2002-03-12 12:35:17

Command line:
	
     asn1step csvtest.asn –encode value -csv noheader,digit,slashes

CSV:

     "Nancy",201,1,"James",1,03/12/02 12:35:17
     "Nancy",201,1,"Martha",0,08/20/10 04:52:40

Default Behavior

The –csv option is turned off.

See Also

↩Options Index


-csvMaxLevel level

Specifies the maximum nesting level inside a PDU type, starting from which values of simple types should NOT be included in the output CSV. The -csvMaxLevel option is used to create a subset of a PDU CSV. In most cases, you won't be able to decode this partial CSV. If the specified maximum level cannot include at least one simple type value, the resulting CSV could be empty.

Example

     Mod DEFINITIONS AUTOMATIC TAGS ::= BEGIN Seq ::= SEQUENCE {
           a SEQUENCE { b BOOLEAN },
           c INTEGER,
           d IA5String
     }

     value Seq ::= { 
        a { b TRUE},     
        c 10,
        d "Test" 
     }

Command line:

     asn1step test -encode value -csv

Output CSV:

     a_b,c,d
     TRUE,10,"Test"

Command line:

     asn1step test.asn -encode value -csv -csvMaxLevel 1

Output CSV:

     c,d
     10,"Test"

Default Behavior

The –csvMaxLevel option is turned off.

See Also

↩Options Index


-csvMinLevel level

Specifies the minimum nesting level inside a PDU type, which is used as a starting point to include simple type values in the output CSV. For the topmost SET, SEQUENCE, or CHOICE types, the deepest level is 0. This option is used to create a subset of a PDU CSV. In most cases, you won't be able to decode this partial CSV because, once some values and separators are skipped, the CSV structure no longer corresponds to the PDU type structure.

Example

     Mod DEFINITIONS AUTOMATIC TAGS ::= BEGIN  Choice ::= [12] CHOICE {
           a SEQUENCE { b BOOLEAN },
           c SEQUENCE { d INTEGER }
     }
     value Choice ::= c : { d  10 }

Command line:

     asn1step test.asn -encode value -csv

Output CSV:

     a_b,c_d
     ,10

Command line:

     asn1step test.asn -encode value -csv -csvMinLevel 1

Output CSV:
     c_d
     10

Default Behavior

The –csvMinLevel option is turned off.

See Also

↩Options Index


-debug | -noDebug

The -debug option instructs ASN-1Step to issue detailed trace data and error messages. The -noDebug option instructs ASN-1Step to disable tracing and detailed error messages. Disabling such detailed tracing slightly improves CPU performance.

Default Behavior

The -debug option is turned on.

↩Options Index


-decFlags anyOneValidFlag

Provides greater control over the decoding conducted by ASN-1Step. Specify one or more valid decoding flags, separated by commas or colons, immediately after the option. To disable a flag, precede it by an exclamation point ("!").

The valid decoding flags are:

  AUTOMATIC_ENCDEC
  DEBUGPDU
  DEBUG_ERRORS
  DONT_DO_DECODED
  DONT_DO_ENCODED
  DONT_FREE_ENCODED
  IGNORE_DEFER_DECODING
  IGNORE_PDU_TAG
  NOCONSTRAIN
  NOTRAPPING
  OSS_RELAXED
  OSS_SKIP_UNKNOWN_CONTENT
  OSS_TRAPPING
  STRICT_CONSTRAINT_CHECKING
  STRICT_ENCODING_DECODING_RULES
  USE_COMPRESSION


-decodePdu <pduID | pduName | 0> <inputFilename.[encodingRules | cdr]> [-ber | -cer | -der | -per | -uper | -oer | -coer | -xer | -cxer | -exer | -json | -asn1value | -csv]

Instructs ASN-1Step to decode the PDU defined in the input ASN.1 specification, given its encoding in a separate file. The name of this file can appear before or after the -decodePdu option on the command line.

Remarks

The -decodePdu option requires an argument that names the PDU in your ASN.1 specification to which the input encoding pertains. For example, you can first use the -listPduId option to learn the names and numbers of the PDUs available for encoding/decoding. Then, you can specify this name or number as an argument to -decodePdu:

asn1step bcas.asn -decodePdu BBCard myCard.xer

Unless PER is used or the input syntax contains PDUs with non-unique tags, ASN-1Step can determine the PDU name or number by specifying the 0 argument:

asn1step bcas.asn -decodePdu 0 myCard.ber

Automatic determination of the PDU number is possible only when the input ASN.1 syntax has unique PDU tags and PER (Aligned or Unaligned) is not used.

ASN-1Step can also decode multiple concatenated PDUs contained within a single input encoding file. It will decode all messages contained in the input file, but all such concatenated messages must be encoded with the same encoding rules.

If the input file contains concatenated messages that pertain to various PDUs, the default decodePdu 0 option enables decoding of such messages. To use this feature, your ASN.1 specification must have unique PDU tags and the encoding rules in use cannot be PER (Aligned or Unaligned).

The inputFilename filename extension determines which encoding rules are used to decode the value:

  • .ber: Basic Encoding Rules (BER)
  • .der: Distinguished Encoding Rules (DER)
  • .per: Aligned variant of the Packed Encoding Rules (PER)
  • .uper: Unaligned variant of the Packed Encoding Rules (UPER)
  • .oer: Unaligned variant of the Octet Encoding Rules (OER)
  • .coer: Unaligned variant of the Canonical Octet Encoding Rules (C-OER)
  • .xer: XML Encoding Rules (XER)
  • .cxer: Canonical XML Encoding Rules (CXER)
  • .cer: Canonical Encoding Rules (CER)
  • .exer: Extended XML Encoding Rules (E-XER)
  • .json: JavaScript Object Notation Encoding Rules (JSON)
  • .txt: input is interpreted as standard ASN.1 value notation
  • .csv: Comma-Separated Value (CSV) format
  • .cdr: Encoding rules for each record are determined based on the CDR record header settings. Currently BER, PER, UPER, and XER
          are supported.

You can re-encode an input encoding using a different set of encoding rules by specifying one of the available encoding rules options. For example:

asn1step bcas.asn -decodePdu BBCard myCard.ber -per

will re-encode the BER-encoded myCard value using Aligned PER. The output PER encoding will be written to a file named myCard.ber.per. Use the -output option to specify a different name for the output encoding file; if multiple input encoding files are specified, only the output file produced from the first input file will have its name affected.

ASN-1Step can create concatenated records when re-encoding several input files. When -decodePdu and -output are specified and re-encoding or value notation creation is requested, all records encoded with the same encoding rules and all values are added into the same file. The filename prefix is derived from the parameter specified in the -output option, and the extension is derived from the encoding rule or is .txt for value notation. If the -concatenate option is specified and the output file already exists, the new records are appended at the end of the existing output file.

ASN-1Step supports the Comma-Separated Value (CSV) format. Note that –decodePDU behaves differently when used with an input .csv file and the –csv <flags> option compared to the other encoding rules.

Use the –csv <flags> option to

  • Specify the flags used to decode the input .csv file. When decoding succeeds, the CSVs are not re-encoded with the same flags. Conversely, when decoding is successful using BER, PER, or other encoding rules, re-encoding is performed.
  • Specify the flags used to re-create CSVs. If decoding fails when flags are used for decoding, ASN-1Step attempts to determine the input .csv file format and decode it. If decoding succeeds, the –csv flags are used to re-create the output .csv file using the new format. If it fails, the error from the first decoding is re-issued.

Default Behavior

-decodePdu 0 is assumed when ASN-1Step encounters input encoding files on the command line and no option is specified.

See Also

↩Options Index


-demo Bcas | PersonnelRecord

Allows ASN-1Step trial users to better experience the capabilities of ASN-1Step by accessing the built-in Bcas or PersonnelRecord sample ASN.1 specifications.

Specify the -demo option followed by either the Bcas or PersonnelRecord argument, then specify any ASN-1Step option to try out the various features of ASN-1Step.

Example

List the available value references in the Bcas specification by entering the following:

asn1step -demo Bcas -valueRefTable

Output

ASN1STEP: List of valid valuereferences and associated PDU numbers:

       1  myCard

Now encode the available value reference using PER:

asn1step -demo Bcas -encodeValue myCard -per

Output

ASN1STEP: Encoding of valuereference 'myCard' for PDU #1:

Encoding to the file 'myCard.per' using PER ALIGNED encoding rule...
BBCard SEQUENCE [fieldcount (not encoded) = 6]
  name IA5String [length = 5.0]
    "Casey"
  team IA5String [length = 13.0]
    "Mudville Nine"
  age INTEGER [length (not encoded) = 0.7]
    32
  position IA5String [length = 10.0]
    "left field"
  handedness ENUMERATED [length (not encoded) = 0.2]
    2
  batting-average REAL [length = 3.0]
    1 * 2^-2
Total encoded length = 37.0
Encoded successfully in 37 bytes:
10436173 6579304D 75647669 6C6C6520 4E696E65 3E486C65 66742066 69656C64
800380FE 01

Next, analyze and decode the encoded data file as follows:

asn1step -demo Bcas -decodePdu BBCard myCard.per

Output

ASN1STEP: Decoding PDU #1 from file 'myCard.per':

rec1value BBCard ::=
{
  --TYPE INFORMATION: SEQUENCE
  --OFFSET: 0,0
  name "Casey",
    --TYPE INFORMATION: IA5String (SIZE(1..60))
    --OFFSET: 0,0; LENGTH: 6,0
    --length: <.000100> (decoded as 5)
    --padding: <00>
    --contents: .43.61.73.65.79
  team "Mudville Nine",
    --TYPE INFORMATION: IA5String (SIZE(1..60))
    --OFFSET: 6,0; LENGTH: 14,0
    --length: <.001100> (decoded as 13)
    --padding: <00>
    --contents: .4D.75.64.76.69.6C.6C.65.20.4E.69.6E.65
  age 32,
    --TYPE INFORMATION: INTEGER (1..100)
    --OFFSET: 20,0; LENGTH: 0,7
    --contents: <.0011111>
  position "left field",
    --TYPE INFORMATION: IA5String (SIZE(1..60))
    --OFFSET: 20,7; LENGTH: 11,1
    --length: <0.01001> (decoded as 10)
    --padding: <000>
    --contents: .6C.65.66.74.20.66.69.65.6C.64
  handedness ambidextrous,
    --TYPE INFORMATION: ENUMERATED {left-handed,right-handed,ambidextrous}
    --OFFSET: 32,0; LENGTH: 0,2
    --contents: <.10>
  batting-average { mantissa 1, base 2, exponent -2 }
    --TYPE INFORMATION: REAL
    --OFFSET: 32,2; LENGTH: 4,6
    --padding: <000000>
    --length: .03 (decoded as 3)
    --type of real number encoding: .80
    --exponent: .FE
    --mantissa: .01
}
--TOTAL LENGTH: 37,0
Successfully decoded 37 bytes.
rec1value BBCard ::=
{
  name "Casey",
  team "Mudville Nine",
  age 32,
  position "left field",
  handedness ambidextrous,
  batting-average { mantissa 1, base 2, exponent -2 }
}

For your reference, following are the Bcas and PersonnelRecord ASN.1 specifications.

Bcas

Bcas DEFINITIONS ::= BEGIN
	BBCard ::= SEQUENCE {
		name IA5String (SIZE (1..60)),
		team IA5String (SIZE (1..60)),
		age INTEGER (1..100),
		position IA5String (SIZE (1..60)),
		handedness ENUMERATED
			{left-handed(0), right-handed(1), ambidextrous(2)},
		batting-average REAL
	}
	myCard BBCard ::= {
		name "Casey",
		team "Mudville Nine",
		age 32,
		position "left field",
		handedness ambidextrous,
		batting-average {250, 10, -3}
	}
END

PersonnelRecord

EmployeeRecord DEFINITIONS ::= BEGIN

 PersonnelRecord ::= [APPLICATION 0] SET {
	name		      Name,
	title		  [0] VisibleString,
	number		      EmployeeNumber,
	dateOfHire	  [1] Date,
	nameOfSpouse [2] Name,
	children	SEQUENCE OF ChildInformation DEFAULT {}
 }

 ChildInformation ::= SET {
	name          Name,
	dateOfBirth   Date
 }

 Name ::= [APPLICATION 1] SEQUENCE{
	givenName	VisibleString,
	initial		VisibleString,
	familyName	VisibleString
 }

 EmployeeNumber ::= [APPLICATION 2] INTEGER
 Date ::= [APPLICATION 3] VisibleString  --  YYYY MMDD
 
 personnelRecord  PersonnelRecord ::= {
	name		{givenName "John", initial "P", familyName "Smith"},
	title		"Director",
	number		51,
	dateOfHire	"19710917",
	nameOfSpouse	{givenName "Mary", initial "T", familyName "Smith"},
	children
	{
		{name  {givenName "Ralph", initial "T", familyName "Smith"},
		dateOfBirth "19571111"},
		{name  {givenName "Susan", initial "B", familyName "Jones"},
		dateOfBirth "19590717"}
	}
 }

END

Default Behavior

The -demo option is turned off.

↩Options Index


-designerWarnings

Instructs ASN-1Step to generate additional warning messages for protocol designers writing ASN.1 specifications.

Remarks

Additional warning messages are issued in the following situations:

  • The -per or -uper option is specified, but a SET, SEQUENCE, or CHOICE type that contains a single component and no extension marker is found. When using PER, this will make adding fields in the future impossible; having an inextensible structured type with only one field is inefficient.
  • The -per or -uper option is specified and there is more than one unreferenced type in the root module, which is the last module in the input. This can cause problems determining the PDU number when decoding, as PER encodings have no tag information. In this case, the application developer must explicitly pass the desired PDU number to the decoder.
  • There is no defined object set used in a table constraint when ObjectSetFromObject notation is used for dummy information object sets.
  • An information object CLASS definition includes a WITH SYNTAX clause, but an optional element is not enclosed in square brackets ("[]").
  • A contents constraint includes only the ENCODED BY clause without a containing type defined, and automatic encoding/decoding is enabled.

Default Behavior

The -designerWarnings option is turned off.

↩Options Index


-dtd

Instructs ASN-1Step to generate multiple Data Type Definitions (DTD) files, one for each PDU. Normally, a separate DTD file is not produced, even when the XML encoding rules (XER) are requested.

Remarks

The DTD filenames will be the same as the PDU type names, with the .dtd suffix added.

When -encodeValue is specified, ASN-1Step can generate a reference for your DTD when producing its XML output for a particular PDU. Just pass the desired .dtd file on the ASN-1Step command line.

Example

asn1step bcas.asn -xer -encodeValue myValue ValueType.dtd

Only one .dtd file is allowed per invocation of ASN-1Step. When multiple -encodeValue options are used, the .dtd specified is used in the XER encoding of the last value reference.

NOTE: To have ASN-1Step generate a system reference to your DTD, leave the filename extension as .dtd. To have ASN-1Step generate a public reference to your DTD, change the filename extension to .pdtd.

Default Behavior

The -dtd option is turned off.

↩Options Index


-encFlags anyOneValidFlag

Provides greater control over the encoding conducted by ASN-1Step. Specify one or more valid encoding flags, separated by commas or colons, immediately after the option. To disable a flag, precede it by an exclamation point ("!").

The valid encoding flags are:

  AUTOMATIC_ENCDEC
  BACK_ALIGN
  COMPACT_XER_ENCODING
  DEBUGPDU
  DEBUG_ERRORS
  DEFAULT_ALIGN
  DEFINITE
  DETERMINE_ENC_LENGTH
  DONT_DO_DECODED
  DONT_DO_ENCODED
  DONT_OPTIMIZE_XMLNS
  FRONT_ALIGN
  IGNORE_DEFER_DECODING
  INDEFINITE
  NOCONSTRAIN
  NOTRAPPING
  NO_XML_DECLARATION
  OSS_AUTO_ENCODE_WITHOUT_CHECKING_CONSTRAINT
  OSS_RELAXED
  OSS_TRAPPING
  RELAY_OPEN_TYPE_IN_HEX
  STRICT_CONSTRAINT_CHECKING
  STRICT_PER_ENCODING_OF_DEFAULT_VALUES
  USE_COMPRESSION

↩Options Index


-encodeValue <valuereference |[pduId,]inputValueFileName.txt> [<outputFileName.encodingRules> | < -ber | -cer | -der | -per | -uper | -oer | -coer | -xer | -cxer | -exer | -json | -csv> ]

Instructs ASN-1Step to encode the valuereference specified in the input ASN.1 specification. Trace data produced during encoding is also printed to standard output when this option is in use.

Remarks

Encode values in a text file

In addition to encoding value references specified directly in the input ASN.1 syntax, you can encode one or more values included in a separate text file whose name is passed to -encodeValue as a parameter. The file may contain one or more ASN.1 values in the form

<valueName> <PduTypeName> ::= <value_notation>

or simply

<value_notation>

In the latter case, you must include a PDU identifier (pduId) along with the text file name in the parameter passed to the -encodeValue option.

For example, to encode the ASN.1 value from the valueFile.txt input file to the outFile.per output file using packed encoding rules, specify

asn1step syntax.asn -encodeValue valueFile.txt outFile.per

where syntax.asn includes

Mod DEFINITIONS ::= BEGIN
        MyStr ::= IA5String
END

valueFile.txt:
     value MyStr ::= "Hello World!"

Output

ASN1STEP: Encoding of value notation from 'valueFile.txt' for PDU #1:

Encoding to the file 'outFile.per' using PER ALIGNED encoding rule...
MyStr IA5String [length = 12.0]
  "Hello World!"
Total encoded length = 13.0
Encoded successfully in 13 bytes:
0C48656C 6C6F2057 6F726C64 21

The following command encodes the ASN.1 value in valueFile.txt with all available encoding rules. A valueFile.txt.* file is generated for each set of encoding rules, where * is the file extension derived from the encoding rules.

asn1step syntax.asn -encodeValue valueFile.txt

outputFileName

The output filename specifies where the encoded data will be written. It can appear before or after the -encodeValue option on the command line. Also, the filename extension determines which encoding rules are used to encode the value:

  • .ber: Basic Encoding Rules (BER)
  • .der: Distinguished Encoding Rules (DER)
  • .per: Aligned variant of the Packed Encoding Rules (PER)
  • .uper: Unaligned variant of the Packed Encoding Rules (UPER)
  • .oer: Unaligned variant of the Octet Encoding Rules (OER
  • .coer: Unaligned variant of the Canonical Octet Encoding Rules (C-OER)
  • .xer: XML Encoding Rules (XER)
  • .cxer: Canonical XML Encoding Rules (CXER)
  • .cer: Canonical Encoding Rules (CER)
  • .exer: Extended XML Encoding Rules (E-XER)
  • .json: JavaScript Object Notation Encoding Rules (JSON)
  • .csv: Comma-Separated Value (CSV) format

Specify specific encoding rules

Specify an encoding rules option along with the -encodeValue keyword to instruct ASN-1Step to encode the named value or one or more values from the input text file using the specified encoding rules. The output encoding file will have a name that is derived from the value or text file to be encoded. For example, to encode a value named myValue using DER, just specify

asn1step syntax.asn -encodeValue myValue -der

ASN-1Step will create a DER-encoding of myValue in the file myValue.der.

To encode a PDU type value with a PDU id of "1" (obtained with –listPduIdentifiers) from valueFile.txt using DER, just specify

asn1step syntax.asn -encodeValue 1,valueFile.txt -der

ASN-1Step will create a DER-encoding of that value in the myValue.der file.

Use optional flags

When used in conjunction with -encodeValue, the -xer, -cxer, or -exer option can be followed by the optional COMPACT_XER_ENCODING, NO_XML_DECLARATION, and DONT_OPTIMIZE_XMLNS flags. When specifying two or more flags, separate them with a comma (",") or colon (":"), for example,

asn1step syntax.asn -encodeValue val -xer COMPACT_XER_ENCODING:NO_XML_DECLARATION

Create concatenated records

ASN-1Step can create concatenated records when encoding several value references at once. When several -encodeValue options are specified with one or more encoding rule options along with the -output<prefix> option, ASN-1Step encodes all specified value references using the specified encoding rules and creates one or more output encoding files. The filenames will have the same prefix as the prefix parameter and the file extensions will be derived from the encoding rules used to encode the values. In addition, if the -concatenate option is specified and the output file already exists, the new records are appended to the content of the output file. In this case, you must make sure that the concatenated records belong to the same PDU. Otherwise, if records were created using PER encoding rules or if the syntax has non-unique PDU tags the decoder will not be able to automatically decode all concatenated messages.

Default Behavior

By default, this option is turned off and ASN-1Step only performs a syntax check on the input files.

See Also

↩Options Index


-errorFile errorFilename

Redirects ASN-1Step error, warning, and informatory messages to a named error file. This is useful on platforms that do not have a simple mechanism for redirecting stdout and stderr to a file.

Remarks

If an error is detected on the command line before the -errorFile option, the message is written to stdout instead of to the error file. List the -errorFile option first on the command line (as shown below) so that all messages resulting from errors on the command line are written to the error file:

asn1step -err myerrs.err foo.asn -test

A suffix of .err is appended to errorFilename if it does not already have an extension. If errorFilename has an extension of .asn, it is replaced with .err; otherwise, errorFilename will keep the extension that you specify. Note that existing error-files with the same name as that specified will be overwritten by a new invocation of ASN-1Step.

Default Behavior

The -errorFile option is turned off.

↩Options Index


-flags anyOneValidFlag

Offers greater control over the encoding and decoding conducted by ASN-1Step. Specify one or more valid common encoding and decoding flags, separated by commas or colons, immediately after the option. To disable a flag, precede it by an exclamation point ("!").

Remarks

You can find a list of valid common encoding and decoding flags in the –decFlags and –encFlags sections.

↩Options Index


-jsonIndent indent

Controls the indentation size for a JSON encoding generated by ASN-1Step. Specify a positive integer argument immediately after this option. A negative integer (-1, for example) enables compact encoding mode.

Default Behavior

The encoder indents two spaces.

↩Options Index


-hexCharacters [numGroupChars]

Specifies that BER, DER, PER (Aligned or Unaligned), OER, or C-OER encoded data will be read or written to a text file that contains hexadecimal characters (i.e., '0' to 'F').

Remarks

The optional numGroupChars argument specifies the number (in the range of 1 to 72) of hexadecimal characters that should be printed before a white space is inserted. By default, numGroupChars has a value of 8.

Example

The following command, issued for samples/sample.asn,

asn1step sample.asn sample.ber -hex -encodeValue myName

will produce a text file named sample.ber that contains

16034F53 53

Default Behavior

ASN-1Step writes the output encoded data to a binary file and expects the input encoded data to be contained within a binary file.

See Also

↩Options Index


-help

Displays a summary of all valid command-line options.

Example

By entering asn1step –help you can obtain a summary of valid command-line options:

OSS ASN-1Step Version 8.2
Copyright (C) 2017 OSS Nokalva, Inc.  All rights reserved.

Compiler parameters: (.D. indicates default)
  <input> <...input> . one or more ASN.1 input files
  <pdufile.<ber|per|der|uper|xer|cxer|cer|exer|oer|coer|json|csv|cdr> <...>
                   ... one or more files containing encoded PDUs (binary by
                       default), suffixes determine encoding rules
  -demo            <Bcas|PersonnelRecord>
                   ... run pre-defined ASN.1 syntax Bcas or PersonnelRecord

  -syntax          ... perform syntax checking only
  -output name     ... generate XSL/DTD files at specified location or use name
                       as the prefix in file names to store re-encoded values
  -nooutput        ... do not generate output encoded files
  -tracefile file  ... write encoder/decoder information to 'file'
  -notrace         ... do not print encoder/decoder tracing information
  -printper flags  ... configure PER analyzer output
  -setnesting limit... nesting limit for decoding SET or SEQUENCE types
  -stringnest limit... nesting limit for decoding constructed strings
  -errorfile file  ... write all messages to 'file' instead of stdout/stderr

  -uniquepdu       .D. check that pdu id's are unique
  -nouniquepdu     ... do not check that pdu id's are unique
  -useXmlNames     ... generates C type and field names according to E-XER
                       "NAME" encoding instructions
  -hexchar <grpDigits>
                   ... read input encoding from or write output encoding to
                       a text file with hexadecimal characters, <grpDigits>
                       specifies a digit-spacing format for the output
  -binchar <grpDigits>
                   ... read input encoding from or write output encoding to
                       a text file with binary characters, <grpDigits>
                       specifies a digit-spacing format for the output

  -constraints     .D. check constraints at runtime
  -restrictedConstraintChecking
                   ... do not ignore the OSS.NoConstrain directive
                       when -constraints is specified
  -noconstraints   ... do not check constraints at runtime
  -relaxper        ... ignore minor PER violations on decode
  -norelaxper      .D. input PER-encoded PDU must strictly conform to PER
  -relaxber        ... ignore minor BER violations on decode
  -norelaxber      .D. input BER-encoded PDU must strictly conform to BER
  -test            ... test encoding/decoding of all ASN.1 valuereferences
  -notest          .D. do not test encoding/decoding of all ASN.1 values
  -debug           .D. issue detailed trace data and error messages
  -nodebug         ... do not issue detailed trace data and error messages
                       to slightly improve CPU performance

 -decodepdu       <pduId|pduTypeName>
                   ... decode all PDU files using a PDU id or a type name
  -allencode       ... encode all valuereference from input ASN.1 file
  -encodevalue     <valuereference|[pduId,]inFileName>
                   ... encode specified valuereference from input ASN.1 file
                       or encode one or more value notations from input text
                       file using specified PDU id
  -concatenate     ... concatenate one or more new encoded records to the
                       content of the output file whose prefix is specified
                       in the -output option
  -listpduid [true]... print table of PDU numbers available for decoding,
                       <true> prints numbers of unreferenced PDU types and
                       some types marked with PDU directives
  -valuereftable   ... print table of valuereferences available for encoding
  -sampleAsn1Value <pduTypeName>[,[<flags>][,<outFileName>]]
                   ... create sample value for the specified PDU type from
                       ASN.1 input
  -allSampleAsn1Values [[<flags>][,<outFileName>]]

  -warning         ... allow warning messages
  -nowarning       ... suppress warning messages
  -suppress msg#   ... suppress a specific message
  -ignoresuppress  ... ignore the SUPPRESS directive (display all messages)
  -verbose         ... display compilation progress messages
  -noverbose       .D. do not display compilation progress messages
  -pedantic        ... rigorously check all modules
  -nopedantic      .D. rigorously check only the root module(s)
  -relaxedMode     .D. automatically select command-line options that
                       result in relaxed compiler behavior, for example,
                       -allowBadValue, -noWarning, etc.
  -norelaxedMode   ... automatically select command-line options that
                       result in strict compiler behavior
  -informatory     ... allow informatory messages
  -noinformatory   ... suppress informatory messages
  -ignoreError msg#... ignore a specific error (issue a warning instead)
  -designerWarnings... issue additional warnings for protocol designers
  -allow badcase   ... allow slight deviations from the ASN.1 standard
  -1990            ... all modules conform to 1990 ASN.1 syntax
  -2015            ... all modules conform to 2015 ASN.1 syntax

  -per             .D. use Aligned PER to encode and decode PDUs
  -uper            .D. use Unaligned PER to encode and decode PDUs
  -ber             .D. use BER to encode and decode PDUs
  -der             .D. use DER to encode and decode PDUs
  -xer <flags>     .D. use XER to encode and decode PDUs using specified flags
  -cxer            .D. use Canonical XER to encode and decode PDUs
  -cer             .D. use CER to encode and decode PDUs
  -exer <flags>    .D. use EXTENDED XER to decode and to encode with specified
                       flags separated by ':' or ','; supported flags are
                       NO_XML_DECLARATION, COMPACT_XML_ENCODING,
                       DONT_OPTIMIZE_XMLNS
  -oer             .D. use OER to encode and decode PDUs
  -coer            .D. use Canonical OER to encode and decode PDUs
  -json <flags>    .D. use JSON to encode and decode PDUs using specified flags
  -csv <flags>     ... use CSV format to encode and decode PDUs with optional
                       flags separated by ',':
                         <';'|':'|'='> ... alternative column separators
                         <'noheader'|  ... do not print CSV header or
                         'singlename'> ... print a compact CSV header
                         'text'        ... do not use UTF-8 file format for CSV
                                           with Unicode characters
                         'column'      ... print values on separate lines
                         'spaces'      ... add spaces around column separators
                         'pduname'     ... add a PDU name to the first header name
                         <num>         ... maximum number of additional CSVs for
                                           SET OF and SEQUENCE OF
                         'digit'       ... print numbers for BOOLEAN and ENUMERATED
                         'noauto'      ... print Open Type values in XML or hex
                         <'ascii'|
                         'bcd'|'tbcd'> ... format for OCTET STRING values
                         <'dashes'|
                         'slashes'>    ... format for GeneralizedTime values
  -csvMinLevel lvl ... include in the CSV only those simple type values
                       that are nested at the specified level or deeper
  -csvMaxLevel lvl ... include in the CSV only those simple type values
                       that are nested not deeper than the specified level
  -jsonIndent indent ... use given indentation for JSON output
  -commandfile <file> ... read command line from 'file'
  -root            ... treat all modules as root modules
  -pdusforopentypes... ignore NOPDU directive for opentypes
  -nopdusforopen   ... do not generate PDUs for info objects with -noconstraints
  -allowbadvalues  ... allow generation of bad values
  -relaySafe       .D. retain unrecognized extension additions at runtime
  -norelaySafe     ... do not retain unrecognized extension additions at runtime
  -autoencdec      ... permit automatic encoding/decoding even if -noconstraint
                       is used
  -messageFormat   <format>
                   ... display error messages in <format>:
                       'oss', 'emacs' or 'msvc'

  -asn1value       ... generate ASN.1 value notation in text file when decoding
  -xsl             ... generate default stylesheet for each PDU
  -dtd             ... generate document type definition file for each PDU
  <file.xsl>       ... XSL stylesheet file for XER encoder
  <file.dtd>       ... system DTD file for XER encoder
  <file.pdtd>      ... public DTD file for XER encoder

  -assignments     ... process type and value assignments defined outside
                       ASN.1 modules
  -pdusforcontainingtypes
                   ... ignore NOPDU directive for types referenced by a
                       contents constraint
  -nopdusforcontainingtypes
                   ... do not generate PDUs for types referenced by a
                       contents constraint
  -ignoreIncompleteItems
                   ... ignore incomplete ASN.1 definitions of types and values
  -ignoreRedefinedAssignments
                   ... ignore redefined ASN.1 definitions of types and values
  -truncatePrintedStrings num#
                   ... truncates long prited strings at the position
                       specified by the <num>
  -flags           ... instruct the encoder and decoder to use flags separated
                       by ':' or ','; to turn off a flag, precede it by '!'
  -encflags        ... instruct the encoder to use the flags separated
                       by ':' or ','; to turn off a flag, precede it by '!'
  -decflags        ... instruct the decoder to use the flags separated
                       by ':' or ','; to turn off a flag, precede it by '!'
  -offset num      ... find the first record to decode at offset 'num'
                       in the input encoding
  -recordOffset num .. start decoding at offset 'num' inside each record
  -noCDRHeadersDetection
                   ... do not automatically detect and skip CDR headers

Remarks

You can obtain a synopsis of the command-line syntax by entering asn1step with no arguments:

> asn1step                                                                                             
OSS ASN-1Step Version 8.2
Copyright (C) 2017 OSS Nokalva, Inc.  All rights reserved.

asn1step <infile(s)> [<inASN1file(s)>   |  -demo <Bcas | PersonnelRecord>]
    [-ber ]  [-root] [-1990  | -2015    ] [-constrain  | -noconstrain    ]
    [-der ]          [-test  | -notest  ] [-unique     | -nounique       ]
    [-cer ]          [-warn  | -nowarn  ] [-verbose    | -noverbose      ]
    [-per ]          [-debug | -nodebug ] [-pedantic   | -nopedantic     ]
    [-uper]          [-assignments      ] [-relaxper   | -norelaxper     ]
    [-oer ]          [-suppress    msg# ] [-binchar       <grpDigits>    ]
    [-coer]          [-ignoresuppress   ] [-relaxber   | -norelaxber     ]
    [-xer   <flags>] [-pdusforopentypes ] [-out <path> | -nooutput       ]
    [-exer  <flags>] [-nopdusforopentype] [-messageFormat <format>       ]
    [-cxer]          [-notrace          |  -tracefile     <tracefile>    ]
    [-csv   <flags>] [-csvMinLevel level] [-csvMaxLevel   <level>        ]
    [-json  <flags>] [-jsonIndent <indent>]
    [-asn1value    ] [-printper    flags] [-commandfile   <commandfile>  ]
    [-dtd ]  [-xsl ] [-allowbadvalues   ] [-inform     | -noinform       ]
    [-ignoreError      message#         ] [-hexchar       <grpDigits>    ]
    [-autoencdec   ] [-designerWarnings ] [-errorfile     <errorfile>    ]
    [-listpduid    ] [-ignoreIncomplete ] [-decodepdu     <pduId|pduName>]
    [-syntax       ] [-pdusforcontainingtypes] [-nopdusforcontainingtypes]
    [-allencode    ] [-valueRefTable] [-encodevalue <valRef|[pduId,]valfile>]
    [-concatenate  ] [-setNesting  limit] [-restrictedConstraintChecking ]
    [-relaxedMode    |-norelaxedMode    ] [-allow <badcase argument>     ]
    [-relaySafe      |-norelaySafe      ] [-ignoreRedefinedAssignments   ]
    [-sampleAsn1Value|-allSampleAsn1Values] [-stringNesting lmt          ]
    [-flags <flags>] [-encflags  <flags>] [-decflags        <flags>      ]
    [-offset num   ] [-recordOffset num ] [-noCDRHeadersDetection        ]
                                          [-truncatePrintedStrings num   ]

enter "asn1step -help" for more information

Default Behavior

Command-line help is not displayed when input files are specified.

↩Options Index


-ignoreError errorNumber

Instructs ASN-1Step to treat certain error message numbers, specified by errorNumber, as warnings instead. Use this option to test the encoding and decoding of PDUs without correcting your ASN.1 specification. However, be aware that the values used are invalid according to the ASN.1 standard.

Remarks

The current version of ASN-1Step can ignore only the following message numbers: 49, 76, 77, 305, 319, 811, 832, 1078, 1130, 1162, 1207, and 1211.

Default Behavior

All the above errors are ignored via the default -relaxedMode option.

See Also

↩Options Index


-ignoreIncompleteItems

Instructs ASN-1Step to treat certain errors related to undefined ASN.1 types and values as warnings, and to ignore incomplete ASN.1 definitions that directly or indirectly reference undefined ASN.1 types or values. This allows you to check PDUs that are fully defined even when the input syntax contains some undefined ASN.1 definitions.

Remarks

ASN.1 types that are referenced only by ignored incomplete types are still not considered to be PDUs by ASN-1Step, unless the global or local PDU directive is applied.

Use the -verbose option along with -ignoreIncompleteItems to see the incomplete items that ASN-1Step ignored.

Example

M DEFINITIONS ::= BEGIN
   A ::= SEQUENCE {
      a1 A1,
      a2 A2,
      b B1
   }
   A1 ::= INTEGER
   A2 ::= BOOLEAN
   B ::= REAL
END

In the test.asn example above, type reference A references type B1, which is undefined.

Output of the "asn1step test.asn -noRelaxedMode" command:

"test.asn", line 5 (M): A0256W: 'B1' is referenced, but is not defined.

"test.asn", line 5 (M): A0052E: 'B1' is not defined.

C0043I: 1 error message, 1 warning message and 0 informatory messages issued.

Partial output of the "asn1step test.asn -ignoreIncompleteItems -verbose" command:

C0284I: Syntax checking file 'test.asn'.

"test.asn", line 5 (M): A0256W: 'B1' is referenced, but is not defined.

"test.asn", line 2 (M): C1215W: The definition of the type identified by the absolute reference 'M.A'
 is incomplete and will be ignored.

C0285I: Global checking abstract syntax.

C0043I: 0 error messages, 2 warning messages and 3 informatory messages issued.

NOTE: The "asn1step test.asn" command gives the same result as "asn1step test.asn -ignoreIncompleteItems" because -relaxedMode is turned on by default, which implies -ignoreIncompleteItems.

Default Behavior

The -ignoreIncompleteItems option is implied by the default -relaxedMode option and is turned off if -noRelaxedMode is specified.

See Also

↩Options Index


-ignoreRedefinedAssignments

Instructs ASN-1Step to treat some errors caused by incorrectly redefined ASN.1 types and values as warnings, and to ignore all duplicate definitions within the same ASN.1 module.

Example

M DEFINITIONS ::= BEGIN
Type ::= INTEGER
Type ::= INTEGER
END

In the test.asn example above, Type is defined twice in the same ASN.1 module, which is normally invalid ASN.1.

The "asn1step test.asn -noRelaxedMode" command without -ignoreRedefinedAssignments results in these errors:

"test.asn", line 3 (M): A0146E: Type 'Type' is illegally redefined.
Type ::= INTEGER
         ^

C0043I: 1 error message, 0 warning messages and 0 informatory messages issued.

The "asn1step test.asn -ignoreRedefinedAssignments" command results in the following:

C1310I: No critical errors found, but message(s) were suppressed due to the compiler's default permissive mode.  
Compile with -noRelaxedMode to see all messages.

C0245I: 1 warning message suppressed, 0 informatory messages suppressed.
To see the suppressed messages use the option -warningMessages.

C0043I: 0 error messages, 0 warning messages and 1 informatory message issued.

NOTE: The command "asn1step test.asn" gives the same result as "asn1step test.asn -ignoreRedefinedAssignments" because -relaxedMode is turned on by default, which implies -ignoreRedefinedAssignments.

Default Behavior

The -ignoreRedefinedAssignments option is implied by the default -relaxedMode option.

See Also

↩Options Index


-ignoreSuppress

Instructs ASN-1Step to ignore any OSS.SUPPRESS directives within an ASN.1 module definition. So, if the module definition contains an OSS.SUPPRESS directive, but the -ignoreSuppress option is specified, messages will not be suppressed.

Default Behavior

All messages identified by the OSS.SUPPRESS directive are suppressed.

↩Options Index


-informatoryMessages | -noInformatoryMessages

Specifies whether ASN-1Step should generate informatory messages.

Remarks

When either -relaxedMode or -noWarningMessages is specified, the -noInformatoryMessages option is implied.

When either -norelaxedMode or -warningMessages is specified, the -informatoryMessages option is implied.

The order in which -informatoryMessages | -noInformatoryMessages, -warningMessages | -noWarningMessages, and -relaxedMode | -noRelaxedMode appear on the command line is important. The rightmost option is enforced, which overrides any effects of the previous options.

Default Behavior

The -noInformatoryMessages option is implied via the default -relaxedMode option.

See Also

↩Options Index


-listPduIdentifiers [true]

Instructs ASN-1Step to display a table of the PDUs available for decoding in the input ASN.1 specification.

Remarks

The option accepts the optional true parameter that instructs ASN-1Step to display only a subset of unreferenced ("true") PDU type names and some types marked with the PDU directive.

If the -noDebug option is specified along with -listPduIdentifiers, only available PDU numbers are printed, all PDU identifiers are printed as <anonymous>.

Example

--<OSS.PDU Mod.P>--
Mod DEFINITIONS AUTOMATIC TAGS ::= BEGIN
      P ::= SEQUENCE {
            id PCLASS.&id ({P-Set}),
            value PCLASS.&Type ({P-Set}{@id})
      }
      PCLASS ::= CLASS {
        &id INTEGER UNIQUE,
        &Type
      }
      P-Set PCLASS ::= { {&id 1, &Type VisibleString} | {&id 2, &Type P} }
      I ::= INTEGER
END

The command line "asn1step test.asn -listPduId" results in the following:

ASN1STEP: List of valid PDU numbers and associated PDU names:

       1  P
       2  I
       3  P-Set-VisibleString

The command line "asn1step test.asn -listPduId true" results in the following:

ASN1STEP: List of valid unreferenced and/or user-defined PDU numbers and associated PDU names:

       1  P
       2  I

Default Behavior

The -listPduIdentifiers option is turned off.

See Also

  • Example using the -listPduIdentifiers option

↩Options Index


-messageFormat formatScheme

Sets the format of the error, warning, and informatory messages issued by ASN-1Step. A mandatory parameter specifies which format scheme is used.

Remarks

Two format schemes are available:

oss
The default message format used by ASN-1Step:
"filename.asn", line [(moduleName)]: code: message
Example:
"msgfmt.asn", line 7 (Module-10): A0217W: The identifier 'address' is missing from the value and is assumed.
   mySeq Seq ::= {int  5, bool TRUE, "350 5th Avenue"}
                                     ^
emacs
This format is compatible with many text editors:
filename.asn:[moduleName:]line:[position:] code: message
Example:
msgfmt.asn:Module-10:7:38: A0217W: The identifier 'address' is missing from the value and is assumed.

You can feed the second format scheme to a parser or compatible text editor to help automatically find the location in the input file where the message was issued.

↩Options Index


-noCDRHeadersDetection

Instructs ASN-1Step to suppress automatic detection and skip CDR headers for certain file formats.

Remarks

The following file formats are supported:

  • CDR files that consist of a CDR file header that occupies 50 or 54 bytes and CDR records that include CDR record headers and BER-based messages.
  • CDR files that include CDR record headers that consist of a record identifier in the first two bytes and a record length in the next two bytes.

Default Behavior

The -noCDRHeadersDetection option is turned off.

↩Options Index


-offset num

Instructs ASN-1Step to locate the first record to decode by skipping num bytes at the beginning of the input encoding.

Remarks

If the input file contains an encoding in text, binary, or hexadecimal format, num bytes is calculated after skipping any number of spaces between digits and after converting from text to binary format.

The -offset option can be used to skip the 3GPP header (included in CDR files) that occupies 50 or 54 bytes. For CDR files, if you use the -offset option with the -recordOffset recNum option, ASN-1Step will skip a CDR header that occupies 4 bytes at the beginning of each record.

Examples

Skip 100 bytes at the beginning of text.ber and start decoding:

asn1step test.asn test.ber -offset 100

Start decoding the first record at offset 54 and the next records at offset 4:

asn1step test.asn -decode PduName test.ber -offset 50 -recordOffset 4

Default Behavior

-offset is turned off; however, ASN-1Step automatically tries to detect and skip CDR headers in the input file with BER-based encoded messages.

The following file formats are supported:

  • CDR files that consist of a CDR file header that occupies 50 or 54 bytes and CDR records that include CDR record headers and BER-based messages.
  • CDR files that include CDR record headers that consist of a record identifier in the first two bytes and a record length in the next two bytes.

To suppress automatic detection, use the -noCDRHeadersDetection command-line option.

See Also

↩Options Index


-output path | -noOutput

Specifies where output files are generated.

Remarks

The -output option also permits you to choose a filename prefix for output files containing re-encoded values created by the -decodeValue option or values in the ASN.1 value format created by the -asn1Value option. However, if multiple separate input files are present only the output file corresponding to the first input file will have its name affected.

You can also choose a filename prefix for output files containing encoded values created by the -encodeValue or -allEncode options. Also, if multiple separate input files are present when a re-encoding action is requested, all records created with the same encoding rule are concatenated in the same output file with the extension corresponding to this encoding rule. In addition, if the -concatenate option is specified and the output file already exists, the new records are appended at the end of the existing output file.

The -noOutput option instructs ASN-1Step to suppress all output other than error messages.

Example

asn1step -encodeValue valueName syntax.asn -ber -output C:\MyAsn1

Default Behavior

ASN-1Step places its output files in the present working directory.

↩Options Index


-pdusForContainingTypes | -noPdusForContainingTypes

The -pdusForContainingTypes option instructs ASN-1Step to always treat types referenced by contents constraints as PDUs.

The -noPdusForContainingTypes option instructs ASN-1Step to not assign PDU numbers to types referenced by contents constraints. In this case, the automatic encoding or decoding of BIT STRING and OCTET STRING types defined with CONTAINING will not be performed.

Default Behavior

Both options are turned off.

↩Options Index


-pdusForOpenTypes | -noPdusForOpenTypes

These options tell ASN-1Step whether to treat open types created by either the ASN1.DeferDecoding or OSS.ENCODABLE directive as PDUs.

Remarks

When -pdusForOpenTypes is used, open types created by any of the ways listed below are treated as PDUs, even when the OSS.NOPDU directive is specified (globally or locally):

  • ASN1.DeferDecoding directive
  • OSS.ENCODABLE directive
  • Component relation constraints

When -noPdusForOpenTypes is used, the compiler does not generate PDU numbers for any open types. For ASN.1 notations with a large number of PDU types, this option can help to prevent the following ASN.1 compiler error:

C0923E: Implementation limit exceeded; too many fields in module.

The -noPdusForOpenTypes option can only be used together with the -noConstraints option, otherwise it will be ignored.

Default Behavior

Both the -pdusForOpenTypes and -noPdusForOpenTypes options are turned off, and only unreferenced types can become PDUs.

↩Options Index


-pedantic | -noPedantic

Instructs ASN-1Step to thoroughly check the entire abstract syntax.

Remarks

The -pedantic option specifies that the entire abstract syntax is to be thoroughly syntax checked. Normally ASN-1Step does not consider it an error if a type is referenced but never defined, so long as it is neither directly nor indirectly referenced by the root modules. The -pedantic option implies the -syntaxOnly option, so no values are encoded or decoded; only a syntax check is performed.

Default Behavior

The -pedantic option is turned off, -noPedantic is implied.

See Also

↩Options Index


-printPerFlags anyOneValidFlag

Offers greater control over the output PER analysis conducted by ASN-1Step.

Remarks

You must specify one or more valid PER analyzer flags, separated by commas or colons, immediately after this option.

The valid flags and their descriptions are listed in the following table:

PER Analysis Flag Description
OSS_ASN_ONLY Print ASN.1 value notation only
OSS_HEXBYTES Print full bytes with hexadecimal notation
OSS_SEPARATE_ASN Separate ASN.1 values
OSS_NOBRACES Do not print braces
OSS_PRINT_ABSREF Print absolute references for sub-fields
OSS_PRINT_OFFSET Print length and offset for sub-fields
OSS_PRINT_NUMBERS Print indentation level numbers
OSS_PRINT_TYPE_INFO Print ASN.1 type information
OSS_PRINT_COMMENTS Print additional comments

Default Behavior

The following PER analyzer flags are used: OSS_PRINT_OFFSET, OSS_HEXBYTES, OSS_PRINT_TYPE_INFO, OSS_PRINT_COMMENTS

↩Options Index


-recordOffset num

Instructs ASN-1Step to start decoding by skipping bytes at the beginning of each record in the input encoding.

Remarks

If the input file contains an encoding in text, binary, or hexadecimal format, num bytes is calculated after skipping any number of spaces between digits and after converting from text to binary format.

The -recordOffset option can be used along with the -offset num option, which instructs ASN-1Step to find the first record to decode at -offset num at the beginning of the input encoding.

Examples

Start decoding each record at offset 10:

asn1step test.asn test.ber -recordOffset 10

Start decoding the first record at offset 54 and the next records at offset 4:

asn1step test.asn -decode PduName test.ber -offset 50 -recordOffset 4

Default Behavior

-recordOffset is turned off; however, ASN-1Step automatically tries to detect and skip CDR headers in the input file with BER-based encoded messages.

The following file formats are supported:

  • CDR files that consist of a CDR file header that occupies 50 or 54 bytes and CDR records that include CDR record headers and BER-based messages.
  • CDR files that include CDR record headers that consist of a record identifier in the first two bytes and a record length in the next two bytes.

To suppress automatic detection, use the -noCDRHeadersDetection command-line option.

See Also

↩Options Index


-relaxedMode | -norelaxedMode

Automatically selects command-line options that result in relaxed or strict compiler behavior.

Remarks

When -relaxedMode is specified, these options are automatically enabled:

  • -allow BadValues
  • -allow MixedCaseForSomeBuiltInTypesNames
  • -allow UnderscoresInAsn1Names
  • -ignoreError (for all ignorable errors)
  • -ignoreIncompleteItems
  • -ignoreRedefinedAssignments
  • -noInformatoryMessages
  • -noWarningMessages

Some significant warning messages are not suppressed when -relaxedMode is used. Use the -noWarningMessages option to suppress all warnings.

-norelaxedMode cancels the options enabled by -relaxedMode and implies the -warningMessages option.

To enable warning or informatory messages when -relaxedMode is specified, specify -warningMessages or -informatoryMessages after -relaxedMode on the command line.

To disable warning or informatory messages when -norelaxedMode is specified, specify -noWarningMessages or -noInformatoryMessages after -norelaxedMode on the command line.

Default Behavior

The -relaxedMode option is turned on.

See Also

↩Options Index


-relaxBER | -noRelaxBER

The -relaxBER option instructs ASN-1Step to silently ignore minor violations to the BER standard while decoding an encoding.

Remarks

-relaxBER instructs ASN-1Step to silently ignore the following types of violations:

  • For example, if the following syntax is used
    I ::= INTEGER (0..MAX)
    and the following encoding of a 123 decimal value is passed to the BER decoder
    0x02, 0x03, 0x80, 0x00, 0x7b
    the decoder normally issues an error message saying that a negative unsigned integer was encountered, which is in strict accordance with the ITU-T Standards. Now, if the -relaxBER option is specified, the decoder decodes the above encoding silently as if it were
    0x02, 0x04, 0x00, 0x80, 0x00, 0x7b
  • If the first 9 bits of the passed encoding are all 1's or all 0's
    0x02, 0x03, 0x00, 0x00, 0x7b
    the decoder normally complains that the integer value encoding is unnecessary long, which is in strict accordance with the Standards. If the -relaxBER option is specified, the decoder decodes such encodings silently.
  • The -relaxBER option also can disable error checks for
    • BIT STRING encodings that omit the leading octet, which tells how many non-significant trailing bits are in the encoding.
    • BIT STRING encodings that are fragmented, but each fragment contains empty octets.
    • Primitive encodings in the indefinite length form.
    • HUGE integer encodings that contain all zeros in the first 9 bits.

Default Behavior

The -noRelaxBER option is implied.

↩Options Index


-relaxPER | -noRelaxPER

The -relaxPER option instructs ASN-1Step to silently ignore minor violations to the PER standard while decoding an encoding.

Remarks

-relaxPER instructs ASN-1Step to silently ignore the following types of violations:

  • Violations relating to the length determinant (part of the PER encoding that precedes all other parts of the encoding) as specified in clause 11.9.3 of X.691. For example,
    Foo1 ::= VisibleString
    could have the following standard and valid PER ALIGNED encoding
    04 6E6E6E6E
    where the first octet (04) defines the length of the contents (in this case, the length is four octets long). However, some applications could incorrectly encode the length field so that the length value can still be retrieved but the format of the length field is non-standard, for example,
    1004 6E6E6E6E
    Normally, the PER decoder issues an error message on receiving such an encoding, since the length determinant is encoded with too many octets. Note that, according to the ASN.1 standard, a two octet length, as shown above, should only be used when the length is larger than 127. To work around such problematic encodings, specify the -relaxPER option to instruct the decoder to retrieve the correct value of the length field while ignoring its incorrect format.
  • Similarly, the -relaxPER option can also be used to instruct the decoder to accept an encoded length which is in the wrong format (i.e. it occupies more bytes than is necessary) for extension additions.
  • The -relaxPER option also can disable error checks for
    • INTEGER encodings which contain unnecessary zero octets.
    • REAL values with the mantissa or exponent encoded in a longer format than they should be.

Default Behavior

The -noRelaxPER option is implied.

↩Options Index


-relaySafe | -noRelaySafe

When specified, -noRelaySafe instructs the decoder to skip unrecognized extension additions. Otherwise, unrecognized extensions are always preserved.

Remarks

By default, the -relaySafe option is implied. ASN-1Step safely relays unknown extension additions when decoding and re-encoding messages with such additions in SEQUENCE, SET, and CHOICE types. The –noRelaySafe option instructs ASN-1Step to silently ignore unknown extension additions when decoding and re-encoding messages.

When -noRelaySafe is used, and the firewall supported version 1 of H.323 is used, and later a version 2 H.323 message containing some added fields (not defined in version 1) is received, the decoder will skip over these added fields and return only the version 1 fields to the firewall application. The problem with this is that if the firewall is to decode and re-encode the message with a new IP address, it would re-encode the message as a version 1 message since the version 2 fields were skipped over during decoding. With relay-safe decoding and encoding, the decoder will retain the value of the fields added in version 2 and, when the message is re-encoded by the firewall application, the encoder will automatically insert the version 2 fields back into the newly encoded message, resulting in a version-2-compliant message with the new IP address - even though the firewall understands only version 1 messages and even though the firewall has no clue as to what is contained in the version 2 fields.

NOTE: You cannot re-encode the unknown extension fields with a set of encoding rules that differ from those that were used to encode them originally.

Default Behavior

The -relaySafe option is turned on.

↩Options Index


-restrictedConstraintChecking

Instructs ASN-1Step not to ignore the OSS.NoConstrain directive when the explicit -constraints option is present.

Remarks

When you use -constraints with -restrictedConstraintChecking, ASN-1Step enables runtime constraint checking for all types except those that have the OSS.NoConstrain directive applied.

NOTE: The -restrictedConstraintChecking option has no effect unless the -constraints option is explicitly specified.

Default Behavior

The -restrictedConstraintChecking option is turned on.

See Also

↩Options Index


-root

Instructs ASN-1Step to treat all input modules as root modules.

Remarks

When you use the -root option, all modules are thoroughly checked for syntax, and all unreferenced types in all modules are considered PDUs.

Default Behavior

Only the last module specified on the command line is treated as a root module.

↩Options Index


-setNestingLimit nestingLimit

This option gives you control over the nesting limit of structured types (SEQUENCE, SET, SEQUENCE OF, SET OF, and CHOICE). You must specify a positive integer argument immediately after this option. Specify zero for unlimited nesting.

Default Behavior

nestingLimit is 64.

↩Options Index


-stringNestingLimit nestingLimit

This option gives you control over the nesting limit of a constructed string encoding. You must specify a positive integer argument immediately after this option. Specify zero for unlimited nesting.

Default Behavior

nestingLimit is 10.

↩Options Index


-suppress messageNumber

Instructs ASN-1Step to suppress a specific warning or informatory message.

Remarks

You can specify -suppress more than once on the command line.

messageNumber can be either the complete message identifier, such as A0210W, or only the numeric portion, such as 210.

Default Behavior

The -suppress option is turned off.

↩Options Index


-syntaxOnly

Instructs ASN-1Step to perform only a syntax check on the ASN.1 input. This is useful when you do not need to encode or decode any values but only wish to check an abstract syntax for correctness.

Default Behavior

The -syntaxOnly option is turned on.

See Also

↩Options Index


-test [-ber | -cer | -der | -per | -uper | -oer | -coer | -xer | -cxer | -exer | -json | -csv] | -noTest

Instructs ASN-1Step to test the encoding and decoding of all value references in the input ASN.1 specification.

Remarks

The -ber, -cer, -der, -per, -uper, -oer, -coer, -xer, -cxer, –exer, -json, and –csv arguments are optional to the -test keyword and instruct ASN-1Step as to which encoding rules should be tested. By default, all available encoding rules are tested.

  • When -ber is specified, the DEFINITE and INDEFINITE length BER encoder/decoder is invoked on the value references in the input specification.
  • When -cer is specified, the CER encoder/decoder is invoked on the value references in the input specification.
  • When -der is specified, the DER encoder/decoder is invoked on the value references in the input specification.
  • When -per is specified, the aligned PER encoder/decoder is invoked on the value references in the input specification.
  • When -uper is specified, the unaligned PER encoder/decoder is invoked on the value references in the input specification.
  • When -oer is specified, the OER encoder/decoder is invoked on the value references in the input specification.
  • When -coer is specified, the Canonical OER encoder/decoder is invoked on the value references in the input specification.
  • When -xer is specified, the XER encoder/decoder is invoked on the value references in the input specification. The following flags can be specified with the -xer option: COMPACT_XER_ENCODING, NO_XML_DECLARATION, DONT_OPTIMIZE_XMLNS.
  • When -cxer is specified, the canonical XER encoder/decoder is invoked on the value references in the input specification.
  • When -exer is specified, the extended XER encoder/decoder is invoked on the value references in the input specification. The following flags can be specified with the -exer option: COMPACT_XER_ENCODING, NO_XML_DECLARATION, DONT_OPTIMIZE_XMLNS.
  • When -json is specified, the JSON encoder/decoder is invoked on the value references in the input specification. The following JSON-specific flags can be specified with the -json option: JSON_COMPACT_ENCODING, JSON_WRAPPED_ENCODING, JSON_ENC_DEFAULT_VALUES, JSON_ENC_ABSENT_COMPONENTS, JSON_USE_UNICODE_ESCAPE_SEQUENCE.
  • When -csv is specified, the CSV encoder/decoder is invoked for the input specification value references. By default, the length of the printed CSV string is truncated for a maximum of 2048 characters. To avoid the default limit, specify –truncate 0.

The following flags can be specified with the -csv option:

Flag Description
';' or ':' or '=' Alternative column separators
'noheader' Do not print CSV header
'singlename' Print a compact CSV header
'text' Do not use UTF-8 file format for CSV with Unicode characters
'column' Print values on separate lines
'spaces' Add spaces around column separators
'pduname' Specify a PDU name for the first header name
<num> Maximum number of additional CSVs for SET OF and SEQUENCE OF
'digit' Print numbers for BOOLEAN and ENUMERATED values
'noauto' Print Open Type values in XML or hexadecimal format
'ascii' or 'bcd' or 'tbcd' Specify the format for OCTET STRING values
'dashes' or 'slashes' Specify a time stamp format for GeneralizedTime values

Default

-test is turned off and -noTest is assumed.

↩Options Index


-traceFile traceFilename | -noTraceFile

Instructs ASN-1Step to write all encoder/decoder trace information to the specified traceFilename file when the -decodePdu or -test option is used.

Default Behavior

This option is turned off.

↩Options Index


-truncatePrintedStrings num

Instructs ASN-1Step to truncate long printed strings at the position specified by the num parameter.

Remarks

If num is 0; no truncation occurs.

Example

A ::= IA5String
a A ::= "12345678901234567890123456789012345678901234567890"

For the syntax above, value A will be printed as follows:

value A ::= "12345678901234567890123456789012345 ..."

This is the result when -truncatePrintedStrings 48 is specified:

value A ::= "123456789012345678901234567890123456789012345678 ..."

Default Behavior

Strings longer than 35 characters are automatically truncated.

↩Options Index


-uniquePDU | -noUniquePDU

The -uniquePDU option specifies that the tags for all PDUs must be unique. When the -noUniquePDU option is specified, ASN-1Step will not issue a warning message when it finds a non-unique PDU tag.

Default Behavior

ASN-1Step issues a warning message when it detects non-unique PDU tags and BER or DER is in use.

↩Options Index


-valueRefTable

Instructs ASN-1Step to display a table of all value references in the input ASN.1 specification that are available for encoding. Each available value reference is listed along with the PDU number of its base type. Refer to section 3.1.2 for an example of how to use this option.

Default Behavior

The -valueRefTable option is turned off.

See Also

  • Example using the -valueRefTable option

↩Options Index


-verbose | -noVerbose

Specifies whether ASN-1Step should issue detailed status messages.

Remarks

These messages display information such as the current input filename and detailed ossinfo information.

Default Behavior

The -noVerbose option is enabled.

↩Options Index


-warningMessages | -noWarningMessages

Specifies whether ASN-1Step should issue warning and informatory messages.

Remarks

-warningMessages implies the -informatoryMessages option; -noWarningMessages implies the -noInformatoryMessages option.

When -norelaxedMode is used, the -warningMessages option is implied.

The order in which the -warningMessages/-noWarningMessages and -relaxedMode/-norelaxedMode options appear on the command line is important. The rightmost option takes precedence.

Default Behavior

The -noWarningMessages option is implied by the default -relaxedMode option. However, some significant warning messages are not suppressed in the default mode. To suppress all warnings, specify the -noWarningMessages option.

See Also

↩Options Index


-xsl

Allows you to generate multiple default stylesheet files, one for each PDU.

Remarks

Normally, separate stylesheets are not produced, even when the XER encoding rules are requested. Instead, you can use your own XML stylesheets or customize those previously generated.

Every stylesheet produced has an .xsl file extension and a filename prefix matching the generated name of its corresponding PDU. You can specify a different filename prefix and extension using the OSS.Stylesheet directive.

You can instruct ASN-1Step to generate a reference for your stylesheet when producing its XML output (i.e., -encodeValue is specified) for a particular PDU by passing the desired .xsl file on the ASN-1Step command line, for example,

asn1step bcas.asn -xer -encodeValue myValue ValueType.xsl

Only one .xsl file is allowed per invocation of ASN-1Step. When multiple -encodeValue options are used, the .xsl specified is used in the XER encoding of the last value reference.

Default Behavior

ASN-1Step does not generate XML stylesheets.

See Also

↩Options Index


This documentation applies to release 8.2 and later of ASN-1Step®. For earlier versions, consult the PDF manual available in your product installation.

Copyright © 2017 OSS Nokalva, Inc. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior permission of OSS Nokalva, Inc.
Every distributed copy of ASN-1Step is associated with a specific license and related unique license number. That license determines, among other things, what functions of ASN-1Step are available to you.