Questions tagged [asn.1]

ASN.1 stands for Abstract Syntax Notation One. It is a data specification language and a set of encoding rules for serializing the data.

ASN.1 stands for Abstract Syntax Notation One. It is part of the Presentation Layer of the OSI model.

ASN.1 specs covers two main roles:

  1. Specifies a notation to define data types and data values.
  2. Specifies different ways of encoding and decoding data values according to the syntax specifications.

Specifications

ASN.1 is an joint ISO/ITU-T standard. The documents covering the specs are:

771 questions
16
votes
7 answers

asn.1 parser in C/Python

I am looking for a solution to parse asn.1 spec files and generate a decoder from those. Ideally I would like to work with Python modules, but if nothing is available I would use C/C++ libraries and interface them with Python with the plethora of…
elventear
  • 341
  • 1
  • 4
  • 10
16
votes
10 answers

What's the best way to serialize data in a language-independent binary format?

I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. Having…
bmdhacks
  • 15,841
  • 8
  • 34
  • 55
15
votes
3 answers

ASN.1 vs JSON when is is appropriate to use them?

When is using ASN.1 preferable to using JSON? What are some advantages and disadvantages of both approaches?
Eric des Courtis
  • 5,135
  • 6
  • 24
  • 37
14
votes
3 answers

I need an example to understand Implicit Tagging in ASN.1

I have been going through the following tutorial http://www.obj-sys.com/asn1tutorial/node12.html Can you help me understand implicit tagging with an example?
Rohit Banga
  • 18,458
  • 31
  • 113
  • 191
13
votes
2 answers

OpenSSL ASN.1 programming tutorial

I'm looking for any C/C++ tutorial, sample code or documentation about using OpenSSL library for ASN.1 DER encoding.
Rython
  • 577
  • 9
  • 17
12
votes
5 answers

Table of OIDs for certificate's subject?

Is there any table where we can find all correspondences between OIDs and attributes they represent in the subject field of certificate. For example, I know that "1.3.6.1.4.1.311.20.2" means certificate's template name, "2.5.29.30" - name…
Sergey
  • 11,548
  • 24
  • 76
  • 113
12
votes
1 answer

ASN.1 DER formatted private key

Why is the modulus padded with leading zeros? I was reading PKCS#1 and PKCS#8 but didn't find anything about it. In c# the leading zeros must be removed, does anybody know why? At http://etherhack.co.uk/asymmetric/docs/rsa_key_breakdown.html, you…
hs2d
  • 6,027
  • 24
  • 64
  • 103
12
votes
1 answer

ASN.1 SEQUENCE tag number encoding

according to for example http://luca.ntop.org/Teaching/Appunti/asn1.html a sequence has the tag number 10 in hexadecimal. But why it is then DER encoded as 30 and not 10? An INTEGER with the tag number 02 in hexadecimal is also encoded as…
Pete
  • 151
  • 1
  • 6
12
votes
4 answers

How does [0] and [3] wơrk in ASN1?

I'm decoding ASN1 (as used in X.509 for HTTPS certificates). I'm doing pretty well, but there is a thing that I just cannot find and understandable documentation for. In this JS ASN1 parser you see a [0] and a [3] under a SEQUENCE element, the first…
Cocoanetics
  • 8,171
  • 2
  • 30
  • 57
11
votes
1 answer

ASN.1 SEQUENCE (OF) real tag value

I am finding a lot of contradicting information regarding the tag value for the SEQUENCE (OF) ASN.1 datatype: Wikipedia claims it is both 0x10 and 0x30: http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One ->…
Krassi
  • 2,336
  • 3
  • 22
  • 30
11
votes
1 answer

Decoding an ASN.1 DER OCTET STRING with OpenSSL

Using the OpenSSL API, I have extracted a custom extension from a X.509v3 certificate with: X509_EXTENSION* ex = X509_get_ext(x509, 4); The X509_EXTENSION object contains a value (ex->value) that is an ASN.1 OCTET STRING. The OCTET STRING contains…
Roger Dahl
  • 15,132
  • 8
  • 62
  • 82
11
votes
3 answers

Do any PHP libraries exist for parsing ASN.1 or generating PHP code based on it?

I've already looked myself but it seems my Google-fu is not strong today. I'm working to develop a standardized protocol for exchanging data structures over a TCP/IP connection between an Apache / PHP server and embedded C code on a…
Grekker
  • 944
  • 1
  • 9
  • 17
11
votes
3 answers

Is there a good C++ library to read, create and modify BER encoded files?

There are several tools that can automatically generate C++ (or other) code for reading and writing BER encoded files. In my C++ project, I need libraries to read and modify BER encoded files. I can not generate C++ classes based on a given data…
Daan
  • 2,478
  • 3
  • 36
  • 76
10
votes
0 answers

Create CSR using PKCS10 and sign with RSA keys In Swift

I generated RSA keys and my backend sends 3 parameters in BASE64 (except signatureAlgorithm) for creating CSR to me: "subject" :…
Mahdi Moqadasi
  • 2,029
  • 4
  • 26
  • 52
10
votes
3 answers

Distinguished Name length constraint in X.509 certificate

In the common name field of the DN of a X509 certificate, as defined in ASN.1 notation for OID "2.5.4.3", the limit is up to 64 characters. Is there any turnaround if we want to have a common name of more than 64 characters?
gingerNinja
  • 411
  • 1
  • 4
  • 12
1
2
3
51 52