Questions tagged [ber]

The Basic Encoding Rules were the original rules laid out by the ASN.1 standard for encoding abstract information into a concrete data stream. The rules, collectively referred to as a transfer syntax in ASN.1 parlance, specify the exact octet sequences which are used to encode a given data item.

Definition:

The Basic Encoding Rules (BER) are the rules that were initiated from the ASN.1 definition for encoding abstract information into a concrete data stream.

The rules, known as a transfer syntax in the ASN.1 parlance, denote the octet sequences which are used to encode a specific piece of data.

Important Links:

50 questions
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
7
votes
1 answer

Parsing PDOL for GET PROCESSING OPTIONS command in EMV transaction

I am trying to build a correctly formatted GET PROCESSING OPTIONS command to be sent to a contactless EMV card. This post has been very helpful but I just need to know a little more detail. When parsing the PDOL, is it safe to assume that each tag…
Scott Condron
  • 1,902
  • 16
  • 20
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
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

Decode SNMP PDUs - Where to Start?

Hello my first ever question on here, in need of bit of guidance. I'm working on a packet sniffer mainly to decode SNMP PDUs, however I am not entirely sure where to go with it. Simply put my packet sniffer can extract information from packets…
Michael01
  • 53
  • 1
  • 1
  • 5
4
votes
1 answer

Interpreting ASN.1 indefinite-lenght encoding with multiple encapsulated octet-strings

I have a BER structure like this... $ openssl asn1parse -inform der -in test.der -i -dump ????:d=4 hl=2 l=inf cons: cont [ 0 ] ????:d=5 hl=3 l= 240 prim: OCTET STRING 0000 - AABBCCDD ????:d=5 hl=2 l= 8 prim: OCTET…
duesee
  • 141
  • 1
  • 9
4
votes
2 answers

Opensource Java ASN.1 decoder that work with automatic tags

I'm new to working with ASN.1 encoded streams and I'm having a hard time finding a free class compiler and decoder, preferably for Java. I have an encoded hex string: String test("30820274800200a2810105820410300c3d830401bb0afc84... Here is an…
user1978816
  • 812
  • 1
  • 8
  • 19
3
votes
2 answers

When reading BERTLV, when do you stop?

I have the following BERTLV: 61394F0BA00000030800001001234579074F05A000012345500E49442D4F6E65205049562042494F5F50107777772E6F626572746875722E636F6D7F66080202800002028000 I'm trying to parse this in a recursive way, so I am treating the first part as…
codenamezero
  • 2,724
  • 29
  • 64
2
votes
1 answer

Additional Octet String in Bouncycastle signed data message

I am creating a CSCA Master list signed data but after successful creation of it, I see two Octet String instead of one in signed message. Please check the source code and output files CMS using BC // load master list signer key …
2
votes
1 answer

How do you encode a post-1994 ASN.1 EXTERNAL type?

Background: Prior to 1994, EXTERNAL was defined like so (with automatic and explicit tagging): EXTERNAL ::= [UNIVERSAL 8] IMPLICIT SEQUENCE { direct-reference OBJECT IDENTIFIER OPTIONAL, indirect-reference INTEGER OPTIONAL, …
Jonathan Wilbur
  • 1,057
  • 10
  • 19
2
votes
1 answer

How do you escape double null octets within an octet string encoded with indefinite length in BER?

I am trying to write a Basic Encoding Rules codec in D, and I would like the ability to encode data with indefinite length encoding, in which the length byte is set to 0x80 and the end of the value bytes is demarcated with a double null 0x00 0x00…
Jonathan Wilbur
  • 1,057
  • 10
  • 19
2
votes
1 answer

Can I specify an Application or Context-Specific tag with C# BerConverter.Encode()?

.NET's System.DirectoryServices.Protocols assembly specifies a light-weight ASN.1 BER encoder, but the documentation is not great: BerConverter. You call it by specifying a format string and a list of objects to encode. INTEGERs can be encoded with…
petrsnd
  • 6,046
  • 5
  • 25
  • 34
2
votes
1 answer

Reading encode asn file manually

how to read encode asn file manually? what is the Tag-Length-Value, Is there a good tutorial ? In the following examples i read each of them but does not clean for me, can anyone help to read each of them : 30 82 02 10 04 01 56 … (for many more…
1
vote
3 answers

How to add OCSPs, CRLs and Certs the Document Security Store (DSS) of a PDF BEFORE Signing in C++?

I am trying to have my PDF’s certification LTV enabled along with the document permission of PDF::DigitalSignatureField::e_no_changes_allowed since this two requirements are a MUST HAVE on the app we are building. As far as I have learned, there is…
anakin
  • 25
  • 3
  • 12
1
vote
0 answers

How to write a multi-valued attribute to LDAP "cn=subschemaSubentry" request?

I'm using this library (the owner not available) to develop a simple LDAP server; With this library, I cannot use any standard LDAP search filters (from any standard LDAP clients) to find anything because there is no default schema. So I decided to…
TheMah
  • 378
  • 5
  • 19
1
2 3 4