privKey = fact.generatePrivate(privKeySpec);
pubKey = fact.generatePublic(pubKeySpec);
PKCS10CertificationRequest req = new PKCS10CertificationRequest(
algorithm, new X509Name("CN=XXX"), pubKey, null, privKey);
if (!req.verify())
{
fail("Failed verify check EC.");
}
req = new PKCS10CertificationRequest(req.getEncoded());
if (!req.verify())
{
fail("Failed verify check EC encoded.");
}
//
// try with point compression turned off
//
((ECPointEncoder)pubKey).setPointFormat("UNCOMPRESSED");
req = new PKCS10CertificationRequest(
algorithm, new X509Name("CN=XXX"), pubKey, null, privKey);
if (!req.verify())
{
fail("Failed verify check EC uncompressed.");
}