public CertificationRequestInfo( ASN1Sequence seq) { version = (DERInteger)seq.getObjectAt(0); subject = X509Name.getInstance(seq.getObjectAt(1)); subjectPKInfo = SubjectPublicKeyInfo.getInstance(seq.getObjectAt(2)); // // some CertificationRequestInfo objects seem to treat this field // as optional. // if (seq.size() > 3) { DERTaggedObject tagobj = (DERTaggedObject)seq.getObjectAt(3); attributes = ASN1Set.getInstance(tagobj, false); } if ((subject == null) || (version == null) || (subjectPKInfo == null)) { throw new ArgumentException("Not all mandatory fields set in CertificationRequestInfo generator."); } }