public void verify(int number, byte[] dg) {
        final byte[] compare = digests.get(number);
        if (compare == null) {
            throw new CryptoException("Could not find digest of data group " + number);
        }
        final byte[] calculated = DigestUtils.digest(algorithm).digest(dg);
        if (!CryptoUtils.compare(compare, calculated, 0)) {
            throw new VerificationException("Digest of data group " + number + " is not equal to security object");
        }
    }
@Test
    public void verifyPcaRvigDg14() throws Exception {
        final LdsSecurityObject ldsSecurityObject = mapper.read(
            readFromCms("pca-rvig"), LdsSecurityObject.class);
        ldsSecurityObject.verify(14, createPcaRvigDg14());
    }