}
private void testCertWithBaseCertificateID()
throws Exception
{
X509AttributeCertificate attrCert = new X509V2AttributeCertificate(certWithBaseCertificateID);
CertificateFactory fact = CertificateFactory.getInstance("X.509", "BC");
X509Certificate cert = (X509Certificate)fact.generateCertificate(new ByteArrayInputStream(holderCertWithBaseCertificateID));
AttributeCertificateHolder holder = attrCert.getHolder();
if (holder.getEntityNames() != null)
{
fail("entity names set when none expected");
}
if (!holder.getSerialNumber().equals(cert.getSerialNumber()))
{
fail("holder serial number doesn't match");
}
if (!holder.getIssuer()[0].equals(cert.getIssuerX500Principal()))
{
fail("holder issuer doesn't match");
}
if (!holder.match(cert))
{
fail("holder not matching holder certificate");
}
if (!holder.equals(holder.clone()))
{
fail("holder clone test failed");
}
if (!attrCert.getIssuer().equals(attrCert.getIssuer().clone()))
{
fail("issuer clone test failed");
}
//equalityAndHashCodeTest(attrCert, certWithBaseCertificateID);