Correct ASN.1 encoding

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Can someone please confirm for me the correct way to encode an empty

As far as I know it should *always* be omitted under both BER and DER
encodings, but I can't lay my hands on something official that confirms it
(and so settle an argument).

In this example, `ThisOne' is empty:
Foo ::= SEQUENCE {
   version INTEGER,
   extra[0] IMPLICIT ThisOne OPTIONAL,
ThisOne ::= SET OF Bar

So should the encoding be
(A) 30 03 02 01 01
(B) 30 05 02 01 01 A0 00

Is (B) ever permissible?

Site Timeline