コード例 #1
0
 /*
  * Initialize to default values, if <java.home>/lib/java.security
  * is not found.
  */
 private static void initializeStatic() {
   props.put("security.provider.1", "sun.security.provider.Sun");
   props.put("security.provider.2", "sun.security.rsa.SunRsaSign");
   props.put("security.provider.3", "com.sun.net.ssl.internal.ssl.Provider");
   props.put("security.provider.4", "com.sun.crypto.provider.SunJCE");
   props.put("security.provider.5", "sun.security.jgss.SunProvider");
   props.put("security.provider.6", "com.sun.security.sasl.Provider");
 }
コード例 #2
0
 /**
  * Sets a security property value.
  *
  * <p>First, if there is a security manager, its <code>checkPermission</code> method is called
  * with a <code>java.security.SecurityPermission("setProperty."+key)</code> permission to see if
  * it's ok to set the specified security property value.
  *
  * @param key the name of the property to be set.
  * @param datum the value of the property to be set.
  * @throws SecurityException if a security manager exists and its <code>{@link
  *          java.lang.SecurityManager#checkPermission}</code> method denies access to set the
  *     specified security property value
  * @throws NullPointerException if key or datum is null
  * @see #getProperty
  * @see java.security.SecurityPermission
  */
 public static void setProperty(String key, String datum) {
   check("setProperty." + key);
   props.put(key, datum);
   invalidateSMCache(key); /* See below. */
 }