@org.junit.Test
public void testSHA256() throws Exception {
Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256);
assertEquals(MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA256, digestAlgorithm.getAlgorithmURI());
byte[] digest = digestAlgorithm.digest("test-string".getBytes());
assertNotNull(digest);
assertTrue(digest.length > 0);
// Now compare against a JDK MessageDigest Object
MessageDigest md = MessageDigest.getInstance("SHA-256");