use of org.bouncycastle.asn1.pkcs.CertificationRequest in project xipki by xipki.
the class CaEmulator method verifyPopo.
private boolean verifyPopo(CertificationRequest csr) {
ScepUtil.requireNonNull("csr", csr);
try {
PKCS10CertificationRequest p10Req = new PKCS10CertificationRequest(csr);
SubjectPublicKeyInfo pkInfo = p10Req.getSubjectPublicKeyInfo();
PublicKey pk = generatePublicKey(pkInfo);
ContentVerifierProvider cvp = getContentVerifierProvider(pk);
return p10Req.isSignatureValid(cvp);
} catch (InvalidKeyException | PKCSException | NoSuchAlgorithmException | InvalidKeySpecException ex) {
LOG.error("could not validate POPO of CSR", ex);
return false;
}
}
Aggregations