pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1798899 - in /pdfbox/branches/2.0: ./ pdfbox/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/
Date Fri, 16 Jun 2017 09:08:35 GMT
Author: lehmi
Date: Fri Jun 16 09:08:35 2017
New Revision: 1798899

URL: http://svn.apache.org/viewvc?rev=1798899&view=rev
Log:
PDFBOX-2963: introduced a singleton holding the security provider to used for encryption/decryption

Added:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityProvider.java
      - copied unchanged from r1789414, pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityProvider.java
Modified:
    pdfbox/branches/2.0/   (props changed)
    pdfbox/branches/2.0/pdfbox/   (props changed)
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlerFactory.java

Propchange: pdfbox/branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 16 09:08:35 2017
@@ -1,3 +1,3 @@
 /pdfbox/branches/no-awt:1618517-1621410
 /pdfbox/no-awt:1618514-1618516
-/pdfbox/trunk:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1766088,1766213,1767585,1768061,1770985,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1790745,1794073,1794090,1794620,1794753,1794859,1794891
+/pdfbox/trunk:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1766088,1766213,1767585,1768061,1770985,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1789414,1790745,1794073,1794090,1794620,1794753,1794859,1794891

Propchange: pdfbox/branches/2.0/pdfbox/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 16 09:08:35 2017
@@ -1,3 +1,3 @@
 /pdfbox/branches/no-awt/pdfbox:1618517-1621410
 /pdfbox/no-awt/pdfbox:1618514-1618516
-/pdfbox/trunk/pdfbox:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1757165,1758817,1767585,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1790745,1794073,1794090,1794620,1794753,1794859,1794891
+/pdfbox/trunk/pdfbox:1736223,1736227,1736615,1737043,1737130,1737599-1737600,1738755,1740160,1742437,1742442,1743248,1745595,1745606,1745772,1745774,1745776,1745779,1746032,1746151,1749162,1749165,1749432,1757165,1758817,1767585,1770988,1772528,1778172,1782679,1786586,1786603,1787546,1789414,1790745,1794073,1794090,1794620,1794753,1794859,1794891

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java?rev=1798899&r1=1798898&r2=1798899&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java
Fri Jun 16 09:08:35 2017
@@ -411,9 +411,10 @@ public final class PublicKeySecurityHand
         Cipher cipher;
         try
         {
-            apg = AlgorithmParameterGenerator.getInstance(algorithm);
-            keygen = KeyGenerator.getInstance(algorithm);
-            cipher = Cipher.getInstance(algorithm);
+            apg = AlgorithmParameterGenerator.getInstance(algorithm,
+                    SecurityProvider.getProvider());
+            keygen = KeyGenerator.getInstance(algorithm, SecurityProvider.getProvider());
+            cipher = Cipher.getInstance(algorithm, SecurityProvider.getProvider());
         }
         catch (NoSuchAlgorithmException e)
         {
@@ -468,7 +469,8 @@ public final class PublicKeySecurityHand
         Cipher cipher;
         try
         {
-            cipher = Cipher.getInstance(algorithmId.getAlgorithm().getId());
+            cipher = Cipher.getInstance(algorithmId.getAlgorithm().getId(),
+                    SecurityProvider.getProvider());
         }
         catch (NoSuchAlgorithmException e)
         {

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlerFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlerFactory.java?rev=1798899&r1=1798898&r2=1798899&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlerFactory.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandlerFactory.java
Fri Jun 16 09:08:35 2017
@@ -23,8 +23,6 @@ import java.security.Security;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
 /**
  * Manages security handlers for the application.
  * It follows the singleton pattern.
@@ -39,11 +37,6 @@ public final class SecurityHandlerFactor
     /** Singleton instance */
     public static final SecurityHandlerFactory INSTANCE = new SecurityHandlerFactory();
 
-    static
-    {
-        Security.addProvider(new BouncyCastleProvider());
-    }
-
     private final Map<String, Class<? extends SecurityHandler>> nameToHandler
=
             new HashMap<String, Class<? extends SecurityHandler>>();
 



Mime
View raw message