< prev index next >

src/java.base/share/classes/javax/net/ssl/TrustManagerFactory.java

Print this page


   1 /*
   2  * Copyright (c) 1999, 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


 115      */
 116     public final String getAlgorithm() {
 117         return this.algorithm;
 118     }
 119 
 120     /**
 121      * Returns a <code>TrustManagerFactory</code> object that acts as a
 122      * factory for trust managers.
 123      *
 124      * <p> This method traverses the list of registered security Providers,
 125      * starting with the most preferred Provider.
 126      * A new TrustManagerFactory object encapsulating the
 127      * TrustManagerFactorySpi implementation from the first
 128      * Provider that supports the specified algorithm is returned.
 129      *
 130      * <p> Note that the list of registered providers may be retrieved via
 131      * the {@link Security#getProviders() Security.getProviders()} method.
 132      *
 133      * @implNote
 134      * The JDK Reference Implementation additionally uses the
 135      * {@code jdk.security.provider.preferred} property to determine

 136      * the preferred provider order for the specified algorithm. This
 137      * may be different than the order of providers returned by
 138      * {@link Security#getProviders() Security.getProviders()}.
 139      *
 140      * @param algorithm the standard name of the requested trust management
 141      *          algorithm.  See the <a href=
 142      *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
 143      *          Java Secure Socket Extension Reference Guide </a>
 144      *          for information about standard algorithm names.
 145      *
 146      * @return the new <code>TrustManagerFactory</code> object.
 147      *
 148      * @exception NoSuchAlgorithmException if no Provider supports a
 149      *          TrustManagerFactorySpi implementation for the
 150      *          specified algorithm.
 151      * @exception NullPointerException if algorithm is null.
 152      *
 153      * @see java.security.Provider
 154      */
 155     public static final TrustManagerFactory getInstance(String algorithm)


   1 /*
   2  * Copyright (c) 1999, 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


 115      */
 116     public final String getAlgorithm() {
 117         return this.algorithm;
 118     }
 119 
 120     /**
 121      * Returns a <code>TrustManagerFactory</code> object that acts as a
 122      * factory for trust managers.
 123      *
 124      * <p> This method traverses the list of registered security Providers,
 125      * starting with the most preferred Provider.
 126      * A new TrustManagerFactory object encapsulating the
 127      * TrustManagerFactorySpi implementation from the first
 128      * Provider that supports the specified algorithm is returned.
 129      *
 130      * <p> Note that the list of registered providers may be retrieved via
 131      * the {@link Security#getProviders() Security.getProviders()} method.
 132      *
 133      * @implNote
 134      * The JDK Reference Implementation additionally uses the
 135      * {@code jdk.security.provider.preferred}
 136      * {@link Security#getProperty(String) Security} property to determine
 137      * the preferred provider order for the specified algorithm. This
 138      * may be different than the order of providers returned by
 139      * {@link Security#getProviders() Security.getProviders()}.
 140      *
 141      * @param algorithm the standard name of the requested trust management
 142      *          algorithm.  See the <a href=
 143      *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
 144      *          Java Secure Socket Extension Reference Guide </a>
 145      *          for information about standard algorithm names.
 146      *
 147      * @return the new <code>TrustManagerFactory</code> object.
 148      *
 149      * @exception NoSuchAlgorithmException if no Provider supports a
 150      *          TrustManagerFactorySpi implementation for the
 151      *          specified algorithm.
 152      * @exception NullPointerException if algorithm is null.
 153      *
 154      * @see java.security.Provider
 155      */
 156     public static final TrustManagerFactory getInstance(String algorithm)


< prev index next >