this.seq = seq;
Enumeration en = seq.getObjects();
while (en.hasMoreElements())
{
ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement();
switch (tObj.getTagNo())
{
case 0:
version = ASN1Integer.getInstance(tObj, false);
break;
case 1:
serialNumber = ASN1Integer.getInstance(tObj, false);
break;
case 2:
signingAlg = AlgorithmIdentifier.getInstance(tObj, false);
break;
case 3:
issuer = X500Name.getInstance(tObj, true); // CHOICE
break;
case 4:
validity = OptionalValidity.getInstance(ASN1Sequence.getInstance(tObj, false));
break;
case 5:
subject = X500Name.getInstance(tObj, true); // CHOICE
break;
case 6:
publicKey = SubjectPublicKeyInfo.getInstance(tObj, false);
break;
case 7:
issuerUID = DERBitString.getInstance(tObj, false);
break;
case 8:
subjectUID = DERBitString.getInstance(tObj, false);
break;
case 9:
extensions = Extensions.getInstance(tObj, false);
break;
default:
throw new IllegalArgumentException("unknown tag: " + tObj.getTagNo());
}
}
}