{"id":19297172,"url":"https://github.com/vlm/asn1c","last_synced_at":"2025-04-22T08:31:13.911Z","repository":{"id":1118419,"uuid":"989603","full_name":"vlm/asn1c","owner":"vlm","description":"The ASN.1 Compiler","archived":false,"fork":false,"pushed_at":"2023-11-28T06:43:01.000Z","size":15464,"stargazers_count":1048,"open_issues_count":238,"forks_count":557,"subscribers_count":102,"default_branch":"master","last_synced_at":"2024-11-09T23:02:22.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://lionet.info/asn1c/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlm.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-10-15T10:38:58.000Z","updated_at":"2024-11-09T21:13:22.000Z","dependencies_parsed_at":"2024-11-09T23:02:21.113Z","dependency_job_id":"40da8413-cd27-40b2-88e4-c015a35e76ac","html_url":"https://github.com/vlm/asn1c","commit_stats":{"total_commits":2385,"total_committers":31,"mean_commits":76.93548387096774,"dds":0.05995807127882602,"last_synced_commit":"9925dbbda86b436896108439ea3e0a31280a6065"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlm%2Fasn1c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlm%2Fasn1c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlm%2Fasn1c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlm%2Fasn1c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlm","download_url":"https://codeload.github.com/vlm/asn1c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250206141,"owners_count":21392193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T23:01:46.251Z","updated_at":"2025-04-22T08:31:10.363Z","avatar_url":"https://github.com/vlm.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# About\n\nASN.1 to C compiler takes the ASN.1 module files (example) and generates\nthe C++ compatible C source code. That code can be used to serialize\nthe native C structures into compact and unambiguous BER/OER/PER/XER-based\ndata files, and deserialize the files back.\n\nVarious ASN.1 based formats are widely used in the industry,\nsuch as to encode the X.509 certificates employed in the HTTPS handshake,\nto exchange control data between mobile phones and cellular networks,\nto perform car-to-car communication in intelligent transportation networks.\n\nThe ASN.1 family of standards is large and complex, and no open source\ncompiler supports it in its entirety.\nThe asn1c is arguably the most evolved open source ASN.1 compiler.\n\n# ASN.1 Transfer Syntaxes\n\u003cdetails\u003e\n\u003csummary\u003eASN.1 encodings interoperability table\u003c/summary\u003e\n\nThe ASN.1 family of standards define a number of ways to encode data,\nincluding byte-oriented (e.g., BER), bit-oriented (e.g., PER),\nand textual (e.g., XER). Some encoding variants (e.g., DER) are just stricter\nvariants of the more general encodings (e.g., BER).\n\nThe interoperability table below specifies which API functions can be used\nto exchange data in a compatible manner. If you need to _produce_ data\nconforming to the standard specified in the column 1,\nuse the API function in the column 2.\nIf you need to _process_ data conforming to the standard(s) specified in the\ncolumn 3, use the API function specified in column 4.\nSee the [doc/asn1c-usage.pdf](doc/asn1c-usage.pdf) for details.\n\nEncoding       | API function       | Understood by | API function\n-------------- | ------------------ | ------------- | -------------\nBER            | der_encode()       | BER           | ber_decode()\nDER            | der_encode()       | DER, BER      | ber_decode()\nCER            | _not supported_    | CER, BER      | ber_decode()\nBASIC-OER      | oer_encode()       | *-OER         | oer_decode()\nCANONICAL-OER  | oer_encode()       | *-OER         | oer_decode()\nBASIC-UPER     | uper_encode()      | *-UPER        | uper_decode()\nCANONICAL-UPER | uper_encode()      | *-UPER        | uper_decode()\n*-APER         | _not supported_    | *-APER        | _not supported_\nBASIC-XER      | xer_encode(XER_F_BASIC)    | *-XER | xer_decode()\nCANONICAL-XER  | xer_encode(XER_F_CANONICAL)| *-XER | xer_decode()\n\n*) Asterisk means both BASIC and CANONICAL variants.\n\u003c/details\u003e\n\n# Build and Install\n\nIf you haven't installed the asn1c yet, read the [INSTALL.md](INSTALL.md) file\nfor a short installation guide.\n\n[![Build Status](https://travis-ci.org/vlm/asn1c.svg?branch=master)](https://travis-ci.org/vlm/asn1c)\n\n# Documentation\n\nFor the list of asn1c command line options, see `asn1c -h` or `man asn1c`.\n\nThe comprehensive documentation on this compiler is in [doc/asn1c-usage.pdf](doc/asn1c-usage.pdf).\n\nPlease also read the [FAQ](FAQ) file.\n\nAn excellent book on ASN.1 is written by Olivier Dubuisson:\n\"ASN.1 Communication between heterogeneous systems\", ISBN:0-12-6333361-0.\n\n# Quick start\n\n(also check out [doc/asn1c-quick.pdf](doc/asn1c-quick.pdf))\n\nAfter installing the compiler (see [INSTALL.md](INSTALL.md)), you may use\nthe asn1c command to compile the ASN.1 specification:\n\n    asn1c \u003cmodule.asn1\u003e                         # Compile module\n\nIf several specifications contain interdependencies, all of them must be\nspecified at the same time:\n\n    asn1c \u003cmodule1.asn1\u003e \u003cmodule2.asn1\u003e ...     # Compile interdependent modules\n\nThe asn1c source tarball contains the [examples/](examples/) directory\nwith several ASN.1 modules and a [script](examples/crfc2asn1.pl)\nto extract the ASN.1 modules from RFC documents.\nRefer to the [examples/README](examples/README) file in that directory.\n\nTo compile the X.509 PKI module:\n\n    ./asn1c/asn1c -P ./examples/rfc3280-*.asn1  # Compile-n-print\n\nIn this example, the **-P** option is to print the compiled text on the\nstandard output. The default behavior is that asn1c compiler creates\nmultiple .c and .h files for every ASN.1 type found inside the specified\nASN.1 modules.\n\nThe compiler's **-E** and **-EF** options are used for testing the parser and\nthe semantic fixer, respectively. These options will instruct the compiler\nto dump out the parsed (and fixed) ASN.1 specification as it was\n\"understood\" by the compiler. It might be useful for checking\nwhether a particular syntactic construction is properly supported\nby the compiler.\n\n    asn1c -EF \u003cmodule-to-test.asn1\u003e             # Check semantic validity\n\n# Model of operation\n\nThe asn1c compiler works by processing the ASN.1 module specifications\nin several stages:\n\n1. During the first stage, the ASN.1 file is parsed.\n   (Parsing produces an ASN.1 syntax tree for the subsequent levels)\n2. During the second stage, the syntax tree is \"fixed\".\n   (Fixing is a process of checking the tree for semantic errors,\n   accompanied by the tree transformation into the canonical form)\n3. During the third stage, the syntax tree is compiled into the target language.\n\nThere are several command-line options reserved for printing the results\nafter each stage of operation:\n\n    \u003cparser\u003e =\u003e print                                       (-E)\n    \u003cparser\u003e =\u003e \u003cfixer\u003e =\u003e print                            (-E -F)\n    \u003cparser\u003e =\u003e \u003cfixer\u003e =\u003e \u003ccompiler\u003e =\u003e print              (-P)\n    \u003cparser\u003e =\u003e \u003cfixer\u003e =\u003e \u003ccompiler\u003e =\u003e save-compiled      [default]\n\n\n-- \nLev Walkin\nvlm@lionet.info\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlm%2Fasn1c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlm%2Fasn1c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlm%2Fasn1c/lists"}