pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1849527 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java
Date Sat, 22 Dec 2018 08:54:33 GMT
Author: tilman
Date: Sat Dec 22 08:54:33 2018
New Revision: 1849527

URL: http://svn.apache.org/viewvc?rev=1849527&view=rev
Log:
PDFBOX-4413: add SHA-256

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java?rev=1849527&r1=1849526&r2=1849527&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/MessageDigests.java
Sat Dec 22 08:54:33 2018
@@ -60,4 +60,20 @@ final class MessageDigests
             throw new RuntimeException(e);
         }
     }
+
+    /**
+     * @return SHA-256 message digest
+     */
+    static MessageDigest getSHA256()
+    {
+        try
+        {
+            return MessageDigest.getInstance("SHA-256");
+        }
+        catch (NoSuchAlgorithmException e)
+        {
+            // should never happen
+            throw new RuntimeException(e);
+        }
+    }
 }



Mime
View raw message