Tools to decode/encode ASN.1 DER.
user guide: https://www.erlang.org/docs/17/apps/asn1/asn1_ug
short version:
example schema(file People.asn
):
People DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Person ::= SEQUENCE {
name PrintableString,
location INTEGER {home(0),field(1),roving(2)},
age INTEGER OPTIONAL
}
END
commands:
$ erlc -bder People.asn
$ erl
> John = {'Person', "John", home, 42}.
> {ok,Bin} = 'People':encode('Person', John).
> {ok,JohnDecoded} = 'People':decode('Person', Bin).
apt install dumpasn1