equal
deleted
inserted
replaced
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package sun.security.jca; |
26 package sun.security.jca; |
27 |
27 |
28 import java.util.*; |
|
29 |
|
30 import java.security.Provider; |
28 import java.security.Provider; |
31 import java.security.Security; |
|
32 |
29 |
33 /** |
30 /** |
34 * Collection of methods to get and set provider list. Also includes |
31 * Collection of methods to get and set provider list. Also includes |
35 * special code for the provider list during JAR verification. |
32 * special code for the provider list during JAR verification. |
36 * |
33 * |
95 // Return to Sun provider or its backup. |
92 // Return to Sun provider or its backup. |
96 // This method should only be called by |
93 // This method should only be called by |
97 // sun.security.util.ManifestEntryVerifier and java.security.SecureRandom. |
94 // sun.security.util.ManifestEntryVerifier and java.security.SecureRandom. |
98 public static Provider getSunProvider() { |
95 public static Provider getSunProvider() { |
99 try { |
96 try { |
100 Class clazz = Class.forName(jarVerificationProviders[0]); |
97 Class<?> clazz = Class.forName(jarVerificationProviders[0]); |
101 return (Provider)clazz.newInstance(); |
98 return (Provider)clazz.newInstance(); |
102 } catch (Exception e) { |
99 } catch (Exception e) { |
103 try { |
100 try { |
104 Class clazz = Class.forName(BACKUP_PROVIDER_CLASSNAME); |
101 Class<?> clazz = Class.forName(BACKUP_PROVIDER_CLASSNAME); |
105 return (Provider)clazz.newInstance(); |
102 return (Provider)clazz.newInstance(); |
106 } catch (Exception ee) { |
103 } catch (Exception ee) { |
107 throw new RuntimeException("Sun provider not found", e); |
104 throw new RuntimeException("Sun provider not found", e); |
108 } |
105 } |
109 } |
106 } |