}
@Override
public boolean verify(final byte[] data, final byte[] signature) {
if (this.publicKey == null) {
throw new SignerException("Public key is null");
}
try {
Signature s = Signature.getInstance(this.signType.getAlgorithm());
s.initVerify(this.publicKey);
s.update(data);
boolean ok = s.verify(signature);
return ok;
} catch (NoSuchAlgorithmException e) {
throw new SignerException(e);
} catch (InvalidKeyException e) {
throw new SignerException(e);
} catch (SignatureException e) {
throw new SignerException(e);
}
}