X509CertSelector selector = new X509CertSelector();
try {
for (int i=0; i<variants.length; i++) {
// make the names objects
X500Principal subject = new X500Principal(variants[i][0]);
Name subject_name = new Name(variants[i][0]);
GeneralName alt_name = new GeneralName(4, variants[i][1]);
// make the certificate to be checked
GeneralNames alt_names_extension = new GeneralNames();
alt_names_extension.addName(alt_name);
TestCert certificate = new TestCert(alt_names_extension);