< prev index next >

src/java.base/share/classes/javax/security/auth/login/Configuration.java

Print this page


   1 /*
   2  * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 296         SecurityManager sm = System.getSecurityManager();
 297         if (sm != null)
 298             sm.checkPermission(new AuthPermission("setLoginConfiguration"));
 299         Configuration.configuration = configuration;
 300     }
 301 
 302     /**
 303      * Returns a Configuration object of the specified type.
 304      *
 305      * <p> This method traverses the list of registered security providers,
 306      * starting with the most preferred Provider.
 307      * A new Configuration object encapsulating the
 308      * ConfigurationSpi implementation from the first
 309      * Provider that supports the specified type is returned.
 310      *
 311      * <p> Note that the list of registered providers may be retrieved via
 312      * the {@link Security#getProviders() Security.getProviders()} method.
 313      *
 314      * @implNote
 315      * The JDK Reference Implementation additionally uses the
 316      * {@code jdk.security.provider.preferred} property to determine

 317      * the preferred provider order for the specified algorithm. This
 318      * may be different than the order of providers returned by
 319      * {@link Security#getProviders() Security.getProviders()}.
 320      *
 321      * @param type the specified Configuration type.  See the Configuration
 322      *    section in the <a href=
 323      *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
 324      *    Java Cryptography Architecture Standard Algorithm Name
 325      *    Documentation</a> for a list of standard Configuration types.
 326      *
 327      * @param params parameters for the Configuration, which may be null.
 328      *
 329      * @return the new Configuration object.
 330      *
 331      * @exception SecurityException if the caller does not have permission
 332      *          to get a Configuration instance for the specified type.
 333      *
 334      * @exception NullPointerException if the specified type is null.
 335      *
 336      * @exception IllegalArgumentException if the specified parameters


   1 /*
   2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 296         SecurityManager sm = System.getSecurityManager();
 297         if (sm != null)
 298             sm.checkPermission(new AuthPermission("setLoginConfiguration"));
 299         Configuration.configuration = configuration;
 300     }
 301 
 302     /**
 303      * Returns a Configuration object of the specified type.
 304      *
 305      * <p> This method traverses the list of registered security providers,
 306      * starting with the most preferred Provider.
 307      * A new Configuration object encapsulating the
 308      * ConfigurationSpi implementation from the first
 309      * Provider that supports the specified type is returned.
 310      *
 311      * <p> Note that the list of registered providers may be retrieved via
 312      * the {@link Security#getProviders() Security.getProviders()} method.
 313      *
 314      * @implNote
 315      * The JDK Reference Implementation additionally uses the
 316      * {@code jdk.security.provider.preferred}
 317      * {@link Security#getProperty(String) Security} property to determine
 318      * the preferred provider order for the specified algorithm. This
 319      * may be different than the order of providers returned by
 320      * {@link Security#getProviders() Security.getProviders()}.
 321      *
 322      * @param type the specified Configuration type.  See the Configuration
 323      *    section in the <a href=
 324      *    "{@docRoot}/../technotes/guides/security/StandardNames.html#Configuration">
 325      *    Java Cryptography Architecture Standard Algorithm Name
 326      *    Documentation</a> for a list of standard Configuration types.
 327      *
 328      * @param params parameters for the Configuration, which may be null.
 329      *
 330      * @return the new Configuration object.
 331      *
 332      * @exception SecurityException if the caller does not have permission
 333      *          to get a Configuration instance for the specified type.
 334      *
 335      * @exception NullPointerException if the specified type is null.
 336      *
 337      * @exception IllegalArgumentException if the specified parameters


< prev index next >