@Test public void test() { DigestConfiguration dc; dc = new DigestConfiguration(null, Collections.singletonMap("digest", "MD5")); assertEquals("MD5", dc.digestAlgorithm); assertEquals("[0-9a-f]{32}", dc.digestPattern.toString()); assertFalse(dc.isValidDigest("dead")); assertTrue(dc.isValidDigest("d41d8cd98f00b204e9800998ecf8427e")); dc = new DigestConfiguration(null, Collections.singletonMap("digest", "SHA-256")); assertEquals("SHA-256", dc.digestAlgorithm); assertEquals("[0-9a-f]{64}", dc.digestPattern.toString()); assertFalse(dc.isValidDigest("dead")); assertTrue(dc.isValidDigest("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); dc = new DigestConfiguration("SHA-512"); assertEquals("SHA-512", dc.digestAlgorithm); assertEquals("[0-9a-f]{128}", dc.digestPattern.toString()); assertFalse(dc.isValidDigest("dead")); assertTrue(dc.isValidDigest( "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e")); }
public boolean isValidDigest(String digest) { return digestPattern.matcher(digest).matches(); }
DigestConfiguration extends PropertyBasedConfiguration { public boolean isValidDigest(String digest) { return digestPattern.matcher(digest).matches(); } }
DigestConfiguration extends PropertyBasedConfiguration { public boolean isValidDigest(String digest) { return digestPattern.matcher(digest).matches(); } DigestConfiguration(String digestAlgorithm);  DigestConfiguration(String systemPropertyPrefix, Map<String, String> properties); }
DigestConfiguration extends PropertyBasedConfiguration { public boolean isValidDigest(String digest) { return digestPattern.matcher(digest).matches(); } DigestConfiguration(String digestAlgorithm);  DigestConfiguration(String systemPropertyPrefix, Map<String, String> properties); boolean isValidDigest(String digest); }
DigestConfiguration extends PropertyBasedConfiguration { public boolean isValidDigest(String digest) { return digestPattern.matcher(digest).matches(); } DigestConfiguration(String digestAlgorithm);  DigestConfiguration(String systemPropertyPrefix, Map<String, String> properties); boolean isValidDigest(String digest); static final String DIGEST_ALGORITHM_PROPERTY; static final String DEFAULT_DIGEST_ALGORITHM; final String digestAlgorithm; final Pattern digestPattern; }