Skip to content

Collection of tools and information for ASN.1 schema conversion.

License

Notifications You must be signed in to change notification settings

siemens/asn1-conv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASN.1 Converter

Collection of tools and information for ASN.1 schema conversion.

The main application is the conversion from ASN.1 schema to JSON schema and/or OpenAPI schema.

References

ASN.1

JSON

Tools

The following dependencies are given:

Additionally, pylint can be used for code review:

pylint src/*.py

asn1Conv.py

Converts an ASN.1 schema to a different format. Note that only a subset of ASN.1 is supported.

Execution examples:

python src/asn1Conv.py --target json etc/schema.asn
python src/asn1Conv.py --target yaml etc/schema.asn

It is also possible to create an output in OpenAPI flavor:

python src/asn1Conv.py --flavor openapi --target yaml etc/schema.asn

Known Limitations

  • The CLASS keyword (X.681) and its friends are not supported.
  • Parameterization (X.683) is not supported.
  • The EMBEDDED PDV type is not supported.
  • The ANY and ANY DEFINED BY types are not supported. They were removed from the ASN.1 standard 1994.
  • The DURATION type is not supported.
  • The INTERSECTION and UNION keywords are not handled distinct. It is treated like UNION for same elements and INTERSETION for others.
  • The keywords PLUS-INFINITY, MINUS-INFINITY and NOT-A-NUMBER cannot be mapped to JSON Schema, hence, are unsupported.
  • WITH COMPONENTS for SEQUENCE OF and SET OF is not supported.
  • Extensions and extension groups are not supported.
  • Only closed value ranges are supported. Not open value ranges.
  • Table constraints are not supported.
  • Extension markers are not supported.
  • The ALL EXCEPT constraint is not supported.
  • The IMPORTS keyword is not supported.
  • The SETTINGS keyword is not supported.
  • XML notation is not supported.

asn1Test.py

Test whether a given JSON file conforms to an ASN.1 schema.

Execution examples:

python src/asn1Test.py --schema etc/schema.asn --element OBSessionOpenData etc/OBSessionOpenData_err.json
python src/asn1Test.py --schema etc/schema.asn --element OBSessionOpenData etc/OBSessionOpenData_ok.json

Known Limitations

  • The CLASS keyword (X.681) and its friends are not supported.
  • Parameterization (X.683) is not supported.
  • The EMBEDDED PDV type is not supported.
  • The ANY and ANY DEFINED BY types are not supported. They were removed from the ASN.1 standard 1994.
  • The date and time related types are not supported.
  • The INTERSECTION and UNION keywords are not handled distinct. It is treated like UNION for same elements and INTERSETION for others.
  • The keywords PLUS-INFINITY, MINUS-INFINITY and NOT-A-NUMBER cannot be mapped to JSON Schema, hence, are unsupported.
  • WITH COMPONENTS is not supported.
  • Extensions and extension groups are not supported.
  • Only closed value ranges are supported. Not open value ranges.
  • Table constraints are not supported.
  • Extension markers are not supported.
  • The ALL EXCEPT constraint is not supported.
  • The PATTERN constraint is not supported.
  • The IMPORTS keyword is not supported.
  • The SETTINGS keyword is not supported.
  • XML notation is not supported.

Other Resources

License

This project is licensed under the MIT license.

About

Collection of tools and information for ASN.1 schema conversion.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages