gen.setSubjectPublicKeyInfo(info);
TBSCertificateStructure tbs = gen.generateTBSCertificate();
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
ASN1OutputStream aOut = new ASN1OutputStream(bOut);
aOut.writeObject(tbs);
if (!isSameAs(bOut.toByteArray(), v1Cert))
{
return new SimpleTestResult(false, getName() + ": failed v1 cert generation");
}
//
// read back test
//
ASN1InputStream aIn = new ASN1InputStream(new ByteArrayInputStream(v2CertList));
DERObject o = aIn.readObject();
bOut = new ByteArrayOutputStream();
aOut = new ASN1OutputStream(bOut);
aOut.writeObject(o);
if (!isSameAs(bOut.toByteArray(), v2CertList))
{
return new SimpleTestResult(false, getName() + ": failed v1 cert read back test");
}