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
6
votes
2 answers

Easy to use extensible serialization/marshalling?

I have a question about serializaton of data structures. There are a many possibilies for serialization of data structures (also called marshalling or deflating, see wiki-article). Every programming language, framework, standard or library seems to…
6
votes
1 answer

How extract all OIDs from certificate with OpenSSL

I have a problem and no idea how I can solve it. I have a X.509v3 certificate with a custom OID (object identifier) in the ExtendedKeyUsage extension. How can I extract all OIDs from the ExtendedKeyUsage using OpenSSL 1.1.0? For example, I created a…
SBond
  • 181
  • 1
  • 9
6
votes
2 answers

Given a PEM document, is it possible to know the format of the bytes from it, or does need information a priori?

Given an arbitrary (valid!) private or public key encoded inside of a PEM, with the pre-encapsulation boundary and post-encapsulation boundaries intact, is it possible to know exactly what format the bytes take (i.e. are they OpenSSL traditional,…
Alex Gaynor
  • 14,353
  • 9
  • 63
  • 113
6
votes
1 answer

How to generate certificate request including generic (arbitrary) extension using OpenSSL?

I have been searching the web for few houres and I cannot find a way to do this. I have already been able to create self-signed CA certificate using these commands: openssl genrsa -out ca.key 1024 openssl req -new -x509 -extensions v3_ca -key ca.key…
Petr
  • 486
  • 7
  • 19
6
votes
2 answers

Confused about BER (Basic Encoding Rules)

I'm trying to study and understand BER (Basic Encoding Rules). I've been using the website http://asn1-playground.oss.com/ to experiment with different ASN.1 objects and encoding them using BER. However, even the simplest encodings seem to confuse…
Channel72
  • 24,139
  • 32
  • 108
  • 180
6
votes
3 answers

What is ASN.1 and it's pros/cons?

I was looking for very generic, strict and platform independent serialization framework. And I discovered something called ASN.1. It looks like something related to serialization, but I couldn't understand actually what it is. I read Wikipedia…
eonil
  • 83,476
  • 81
  • 317
  • 516
5
votes
3 answers

How to work on ASN.1 and impliment structures in it?

I want to implement some protocol using asn.1 so what i have to do declare structures and tag there name in some header file and implement asn.1's encoding rule as a function. Can you suggest me some tutorial or book to refer. I don't know how to…
tod
  • 81
  • 1
  • 6
5
votes
2 answers

How do you generate a CSR in Java without signing it by the requester?

Basically, I need to isolate the data of the constructed CSR (Certificate Signing Request) prior to it being first signed by the entity making the request, preferably in Java. Many thanks in advance! It would also be useful to note how to…
penguin4hire
  • 288
  • 1
  • 2
  • 14
5
votes
3 answers

Java ASN.1 validation library

Is there any free open-source java library to validate ASN.1 BER/DER/XER over module definitions file.
Timofey Gorshkov
  • 4,987
  • 6
  • 41
  • 66
5
votes
0 answers

How to add a custom attribute to a CMS message with Apple CMS services?

We would like to add an additional OID tag to the CMS signer info sequence using the Cryptographic Message Syntax Services library in macOS. We are able to generate a CMS message using the provided CMSEncoder* functions but are unable to insert the…
katrasnikj
  • 3,151
  • 3
  • 16
  • 27
5
votes
1 answer

OpenSSL generate and sign certificate with custom subject fields

I need to create and sign (I am CA) certificate with custom subject (, SERIALNUMBER=...,). So far I have modified openssl config file so I am able to inclde custom fields in subject. [ new_oids ] SERIALNUMBER = 1.2.3.4.1333 Problem is, that after…
0xDEAD BEEF
  • 2,074
  • 7
  • 31
  • 46
5
votes
2 answers

Encoding of implicit and explicit tags in ASN.1

I am trying to understand how IMPLICIT and EXPLICIT tags are actually encoded in the DER binary form. The basic examples are clear. Plain integer, x INTEGER ::= 5 is encoded as a TLV triple 02 01 05. In x [2] IMPLICIT INTEGER ::= 5 implicit tag 82…
klk206
  • 454
  • 4
  • 8
5
votes
1 answer

Signing and creating a asn1 signedmessage - Bouncycastle

Is there any good tutorials on how to sign a file, and wrap it inside a asn1 pkcs7 package using bouncycastle?
marcelo-ferraz
  • 3,147
  • 4
  • 38
  • 55
5
votes
1 answer

Why is unmarshalling of a DER ASN.1 large integer limited to SEQUENCE in Golang?

I would like to be able to unmarshal a large integer from a DER file using the encoding/asn1 package, but it looks like it only works for a SEQUENCE of integers. For example, this does not work, which is strange because the marshaling of the Big Int…
Kirabou
  • 53
  • 6
5
votes
1 answer

How to parse DER bytes?

I am trying to create cert for Elasticsearch Searchguard. One requirement is that the cert must include oid:1.2.3.4.5.5 in SANs. I am using GO to generate that cert. After some trial and error I have figured out that if I use []byte{0x88, 0x05,…
codefx
  • 9,872
  • 16
  • 53
  • 81