@Override public CHKBlock construct(byte[] data, byte[] headers, byte[] routingKey, byte[] fullKey, boolean canReadClientCache, boolean canReadSlashdotCache, BlockMetadata meta, DSAPublicKey ignored) throws KeyVerifyException { if(data == null || headers == null) throw new CHKVerifyException("Need either data and headers"); return CHKBlock.construct(data, headers, NodeCHK.cryptoAlgorithmFromFullKey(fullKey)); }
throw new CHKVerifyException("Hash not SHA-256"); MessageDigest md = SHA256.getMessageDigest(); byte[] check = chk.routingKey; if(!java.util.Arrays.equals(hash, check)) { throw new CHKVerifyException("Hash does not verify");