Home → ASN.1

Tag: extensibility

Question: Extensibility and dropping fields

Date: 2010-September-21 @ 16:42
Tags: extensibility, support

Today's email was asking me about an interesting case of ASN.1 extensibility. Usually, extensibility means adding new members to existing structures. In this case, the user was asking whether ASN.1 supports removing structure members.

Hello, Mr. Walkin.

I am using the ASN.1 compiler and for an application I am developing. I am using this to store the datastructure in a file, for persistence. I am trying to find out whether forward compatibility is support. By this I mean the following.

In the version 1 I have the following structure:

Struct a {
	Int x;
	Int y;
	Int z;
}
I store the data x = 111; y = 222 and z = 333;

Now I upgrade the software to the version 2 where in the new struct is:

Struct a {
	Int x;
	// int y is removed
	Int z;
}

Now when I read the existing file (generated with the older version of ASN.1 specification) with the newer version of the software, I get the following data back: x = 111, and z = 222.

Can you please tell me whether it is possible to get x = 111 and z = 333. If yes, then what ASN syntax should I follow? I am using der_encode and ber_decode.

(Continue reading…)


The ASN.1 Compiler Copyright © 2003—2017 Lev Walkin <vlm@lionet.info>