should use tagged object in ASN.1 Choice ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

should use tagged object in ASN.1 Choice ?

Gsealy
Hi all,

We define some ASN.1 sequence for OCSP sync, but have a problem. sequence define below:
CertData:: = Choice {
   issuedData   IssuedData,
   revokedData  RevokedData
}
IssuedData:: = SEQUENCE {
   serialNumber INTEGER,
   issueTime         GeneralizedTime
}
RevokedData:: = SEQUENCE {
   serialNumber     INTEGER,
   revokeTime       GeneralizedTime,
   revokeReason     CRLReason, // X.509 CRLReason
}

IssuedData and RevokedData is constructed object define by ourself, should CertData sequence add tag number
to distinguish those? like:
CertData:: = Choice {
   issuedData   [0] IssuedData,
   revokedData  [1] RevokedData
}

X.690 says, The tag used in the identifier octets is the tag of the chosen type, as specified in the 
ASN.1 definition of the choice type. not says must use tagged object with constructed. we found 
org.bouncycastle.asn1.x509.Time don't have tag, but it use two primitive object(UTCTime & GeneralizedTime),

So, as standard implement, should we add tagged object in Choice object with constructed?

Thanks,
Gsealy