< prev index next >

jdk/src/java.naming/share/classes/sun/security/provider/certpath/ldap/JdkLDAP.java

Print this page




  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
  23  * questions.
  24  */
  25 
  26 package sun.security.provider.certpath.ldap;
  27 
  28 import java.util.HashMap;
  29 import java.util.List;
  30 import java.security.*;
  31 import java.security.cert.CertStoreParameters;
  32 
  33 /**
  34  * Provider class for the JdkLDAP provider.
  35  * Supports LDAP cert store.
  36  *
  37  * @since   1.9
  38  */
  39 public final class JdkLDAP extends Provider {
  40 
  41     private static final long serialVersionUID = -2279741232933606418L;
  42 
  43     private static final class ProviderService extends Provider.Service {
  44         ProviderService(Provider p, String type, String algo, String cn,
  45             List<String> aliases, HashMap<String, String> attrs) {
  46             super(p, type, algo, cn, aliases, attrs);
  47         }
  48 
  49         @Override
  50         public Object newInstance(Object ctrParamObj)
  51             throws NoSuchAlgorithmException {
  52             String type = getType();
  53             String algo = getAlgorithm();
  54             if (type.equals("CertStore") && algo.equals("LDAP")) {
  55                 if (ctrParamObj != null &&
  56                     !(ctrParamObj instanceof CertStoreParameters)) {
  57                     throw new InvalidParameterException




  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
  23  * questions.
  24  */
  25 
  26 package sun.security.provider.certpath.ldap;
  27 
  28 import java.util.HashMap;
  29 import java.util.List;
  30 import java.security.*;
  31 import java.security.cert.CertStoreParameters;
  32 
  33 /**
  34  * Provider class for the JdkLDAP provider.
  35  * Supports LDAP cert store.
  36  *
  37  * @since   9
  38  */
  39 public final class JdkLDAP extends Provider {
  40 
  41     private static final long serialVersionUID = -2279741232933606418L;
  42 
  43     private static final class ProviderService extends Provider.Service {
  44         ProviderService(Provider p, String type, String algo, String cn,
  45             List<String> aliases, HashMap<String, String> attrs) {
  46             super(p, type, algo, cn, aliases, attrs);
  47         }
  48 
  49         @Override
  50         public Object newInstance(Object ctrParamObj)
  51             throws NoSuchAlgorithmException {
  52             String type = getType();
  53             String algo = getAlgorithm();
  54             if (type.equals("CertStore") && algo.equals("LDAP")) {
  55                 if (ctrParamObj != null &&
  56                     !(ctrParamObj instanceof CertStoreParameters)) {
  57                     throw new InvalidParameterException


< prev index next >