cert = certGen.generate(privKey);
cert.checkValidity(new Date());
cert.verify(pubKey);
boolean[] subjectUniqueId = cert.getSubjectUniqueID();
if (!Arrays.areEqual(subjectUniqID, subjectUniqueId))
{
fail("Subject unique id is not correct, original: "+arrayToString(subjectUniqID)+", from cert: "+arrayToString(subjectUniqueId));