Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 17 java.naming.jmod - Naming Module
JDK 17 java.naming.jmod is the JMOD file for JDK 17 Naming module.
JDK 17 Naming module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.naming.jmod.
JDK 17 Naming module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Naming module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.naming.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
/* * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package com.sun.jndi.ldap.sasl; import javax.security.auth.callback.*; import javax.security.sasl.RealmCallback; import javax.security.sasl.RealmChoiceCallback; import java.io.IOException; /** * DefaultCallbackHandler for satisfying NameCallback and * PasswordCallback for an LDAP client. * NameCallback is used for getting the authentication ID and is * gotten from the java.naming.security.principal property. * PasswordCallback is gotten from the java.naming.security.credentials * property and must be of type String, char[] or byte[]. * If byte[], it is assumed to have UTF-8 encoding. * * If the caller of getPassword() will be using the password as * a byte array, then it should encode the char[] array returned by * getPassword() into a byte[] using UTF-8. * * @author Rosanna Lee */ final class DefaultCallbackHandler implements CallbackHandler { private char[] passwd; private String authenticationID; private String authRealm; DefaultCallbackHandler(String principal, Object cred, String realm) throws IOException { authenticationID = principal; authRealm = realm; if (cred instanceof String) { passwd = ((String)cred).toCharArray(); } else if (cred instanceof char[]) { passwd = ((char[])cred).clone(); } else if (cred != null) { // assume UTF-8 encoding String orig = new String((byte[])cred, "UTF8"); passwd = orig.toCharArray(); } } public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof NameCallback) { ((NameCallback)callbacks[i]).setName(authenticationID); } else if (callbacks[i] instanceof PasswordCallback) { ((PasswordCallback)callbacks[i]).setPassword(passwd); } else if (callbacks[i] instanceof RealmChoiceCallback) { /* Deals with a choice of realms */ String[] choices = ((RealmChoiceCallback)callbacks[i]).getChoices(); int selected = 0; if (authRealm != null && authRealm.length() > 0) { selected = -1; // no realm chosen for (int j = 0; j < choices.length; j++) { if (choices[j].equals(authRealm)) { selected = j; } } if (selected == -1) { StringBuilder allChoices = new StringBuilder(); for (int j = 0; j < choices.length; j++) { allChoices.append(choices[j]).append(','); } throw new IOException("Cannot match " + "'java.naming.security.sasl.realm' property value, '" + authRealm + "' with choices " + allChoices + "in RealmChoiceCallback"); } } ((RealmChoiceCallback)callbacks[i]).setSelectedIndex(selected); } else if (callbacks[i] instanceof RealmCallback) { /* 1 or 0 realms specified in challenge */ RealmCallback rcb = (RealmCallback) callbacks[i]; if (authRealm != null) { rcb.setText(authRealm); // Use what user supplied } else { String defaultRealm = rcb.getDefaultText(); if (defaultRealm != null) { rcb.setText(defaultRealm); // Use what server supplied } else { rcb.setText(""); // Specify no realm } } } else { throw new UnsupportedCallbackException(callbacks[i]); } } } void clearPassword() { if (passwd != null) { for (int i = 0; i < passwd.length; i++) { passwd[i] = '\0'; } passwd = null; } } @SuppressWarnings("deprecation") protected void finalize() throws Throwable { clearPassword(); } }
⏎ com/sun/jndi/ldap/sasl/DefaultCallbackHandler.java
Or download all of them as a single archive file:
File name: java.naming-17.0.5-src.zip File size: 490626 bytes Release date: 2022-09-13 Download
⇒ JDK 17 java.net.http.jmod - Net HTTP Module
2023-09-23, 6409👍, 0💬
Popular Posts:
JDK 11 jdk.xml.dom.jmod is the JMOD file for JDK 11 XML DOM module. JDK 11 XML DOM module compiled c...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module. JDK 11 JFR module compiled class files a...
What Is commons-net-ftp-2.0.jar? commons-net-ftp-2.0.jar is the JAR file for Apache Commons Net FTP ...
Where to find answers to frequently asked questions on Download and Installing of Older Versions? He...