jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java
changeset 16909 78a1749a43e2
parent 15010 ec6b49ce42b1
child 17918 37620367ceb7
equal deleted inserted replaced
16850:f6f6c2182678 16909:78a1749a43e2
    88     private static final String OID_PKCS5_PBES2 = "1.2.840.113549.1.5.13";
    88     private static final String OID_PKCS5_PBES2 = "1.2.840.113549.1.5.13";
    89     private static final String OID_PKCS3 = "1.2.840.113549.1.3.1";
    89     private static final String OID_PKCS3 = "1.2.840.113549.1.3.1";
    90 
    90 
    91     /* Are we debugging? -- for developers */
    91     /* Are we debugging? -- for developers */
    92     static final boolean debug = false;
    92     static final boolean debug = false;
       
    93 
       
    94     // Instance of this provider, so we don't have to call the provider list
       
    95     // to find ourselves or run the risk of not being in the list.
       
    96     private static volatile SunJCE instance = null;
    93 
    97 
    94     // lazy initialize SecureRandom to avoid potential recursion if Sun
    98     // lazy initialize SecureRandom to avoid potential recursion if Sun
    95     // provider has not been installed yet
    99     // provider has not been installed yet
    96     private static class SecureRandomHolder {
   100     private static class SecureRandomHolder {
    97         static final SecureRandom RANDOM = new SecureRandom();
   101         static final SecureRandom RANDOM = new SecureRandom();
   768                         "SunTlsRsaPremasterSecret");
   772                         "SunTlsRsaPremasterSecret");
   769 
   773 
   770                     return null;
   774                     return null;
   771                 }
   775                 }
   772             });
   776             });
       
   777 
       
   778         if (instance == null) {
       
   779             instance = this;
       
   780         }
       
   781     }
       
   782 
       
   783     // Return the instance of this class or create one if needed.
       
   784     static SunJCE getInstance() {
       
   785         if (instance == null) {
       
   786             return new SunJCE();
       
   787         }
       
   788         return instance;
   773     }
   789     }
   774 }
   790 }