/** * Verifies the signature on this CertificationRequest, using the given public key and * CryptoToken. Does not indicate the CertificationRequest is valid at any specific time. */ public void verify(PublicKey key, CryptoToken token) throws NoSuchAlgorithmException, CertificateException, TokenException, SignatureException, InvalidKeyException { Signature sig = token.getSignatureContext(SignatureAlgorithm.fromOID(algId.getOID())); sig.initVerify(key); sig.update(infoEncoding); if (!sig.verify(signature)) { throw new CertificateException("Signature is invalid"); } }