@org.junit.Test
public void testMD5() throws Exception {
Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
MessageDigestAlgorithm digestAlgorithm =
MessageDigestAlgorithm.getInstance(doc, MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5);
assertEquals(MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5, 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("MD5");