Frage
I needed compiling and generate a .DER file from my example ASN1
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 {mantissa 250, base 10, exponent -3}
}
END
I don't know how to do it, I try asn1c
command, but this compiling C/C++.
Any help please.
Lösung
In general, you use an ASN.1 compiler to generate C, C++ or Java code from the ASN.1 specification, then write your own program to call the encoder with the data you would like encoded in DER.
You could also try a GUI such as the OSS ASN.1 Studio from OSS Nokalva which allows you to compile an ASN.1 specification, and encode/decode/edit values without needing to write any code. Try downloading a free trial of the OSS ASN.1 Tools for C, C++ or Java, all of which include a free trial of the OSS ASN.1 Studio IDE. You can download a free trial from http://www.oss.com/asn1/products/asn1-download.html.