Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create .DER from ASN1

Tags:

c

asn.1

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.

like image 892
eluish192 Avatar asked Sep 01 '25 20:09

eluish192


1 Answers

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.

like image 60
Paul Thorpe Avatar answered Sep 03 '25 19:09

Paul Thorpe