CertPath cert_path = factory.generateCertPath(bais);
encoding = cert_path.getEncoded("PKCS7");
X509CertPathImpl cpath = X509CertPathImpl
.getInstance(encoding, "PKCS7");
assertEquals("Certificate list size missmatch", certList.size(), cpath
.getCertificates().size());
bais = new ByteArrayInputStream(encoding);
cpath = X509CertPathImpl.getInstance(bais, "PKCS7");
assertEquals("Certificate list size missmatch", certList.size(), cpath
.getCertificates().size());
}