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
⏎ javax/naming/ldap/StartTlsRequest.java
/* * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.naming.ldap; import java.util.Iterator; import java.security.AccessController; import java.security.PrivilegedAction; import javax.naming.ConfigurationException; import javax.naming.NamingException; import com.sun.naming.internal.VersionHelper; import java.util.ServiceLoader; import java.util.ServiceConfigurationError; /** * This class implements the LDAPv3 Extended Request for StartTLS as * defined in * <a href="http://www.ietf.org/rfc/rfc2830.txt">Lightweight Directory * Access Protocol (v3): Extension for Transport Layer Security</a> * * The object identifier for StartTLS is 1.3.6.1.4.1.1466.20037 * and no extended request value is defined. *<p> * {@code StartTlsRequest}/{@code StartTlsResponse} are used to establish * a TLS connection over the existing LDAP connection associated with * the JNDI context on which {@code extendedOperation()} is invoked. * Typically, a JNDI program uses these classes as follows. * <blockquote><pre> * import javax.naming.ldap.*; * * // Open an LDAP association * LdapContext ctx = new InitialLdapContext(); * * // Perform a StartTLS extended operation * StartTlsResponse tls = * (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest()); * * // Open a TLS connection (over the existing LDAP association) and get details * // of the negotiated TLS session: cipher suite, peer certificate, etc. * SSLSession session = tls.negotiate(); * * // ... use ctx to perform protected LDAP operations * * // Close the TLS connection (revert back to the underlying LDAP association) * tls.close(); * * // ... use ctx to perform unprotected LDAP operations * * // Close the LDAP association * ctx.close; * </pre></blockquote> * * @since 1.4 * @see StartTlsResponse * @author Vincent Ryan */ public class StartTlsRequest implements ExtendedRequest { // Constant /** * The StartTLS extended request's assigned object identifier * is 1.3.6.1.4.1.1466.20037. */ public static final String OID = "1.3.6.1.4.1.1466.20037"; // Constructors /** * Constructs a StartTLS extended request. */ public StartTlsRequest() { } // ExtendedRequest methods /** * Retrieves the StartTLS request's object identifier string. * * @return The object identifier string, "1.3.6.1.4.1.1466.20037". */ public String getID() { return OID; } /** * Retrieves the StartTLS request's ASN.1 BER encoded value. * Since the request has no defined value, null is always * returned. * * @return The null value. */ public byte[] getEncodedValue() { return null; } /** * Creates an extended response object that corresponds to the * LDAP StartTLS extended request. * <p> * The result must be a concrete subclass of StartTlsResponse * and must have a public zero-argument constructor. * <p> * This method locates the implementation class by locating * configuration files that have the name: * <blockquote>{@code * META-INF/services/javax.naming.ldap.StartTlsResponse * }</blockquote> * The configuration files and their corresponding implementation classes must * be accessible to the calling thread's context class loader. * <p> * Each configuration file should contain a list of fully-qualified class * names, one per line. Space and tab characters surrounding each name, as * well as blank lines, are ignored. The comment character is {@code '#'} * ({@code 0x23}); on each line all characters following the first comment * character are ignored. The file must be encoded in UTF-8. * <p> * This method will return an instance of the first implementation * class that it is able to load and instantiate successfully from * the list of class names collected from the configuration files. * This method uses the calling thread's context classloader to find the * configuration files and to load the implementation class. * <p> * If no class can be found in this way, this method will use * an implementation-specific way to locate an implementation. * If none is found, a NamingException is thrown. * * @param id The object identifier of the extended response. * Its value must be "1.3.6.1.4.1.1466.20037" or null. * Both values are equivalent. * @param berValue The possibly null ASN.1 BER encoded value of the * extended response. This is the raw BER bytes * including the tag and length of the response value. * It does not include the response OID. * Its value is ignored because a Start TLS response * is not expected to contain any response value. * @param offset The starting position in berValue of the bytes to use. * Its value is ignored because a Start TLS response * is not expected to contain any response value. * @param length The number of bytes in berValue to use. * Its value is ignored because a Start TLS response * is not expected to contain any response value. * @return The StartTLS extended response object. * @throws NamingException If a naming exception was encountered * while creating the StartTLS extended response object. */ public ExtendedResponse createExtendedResponse(String id, byte[] berValue, int offset, int length) throws NamingException { // Confirm that the object identifier is correct if ((id != null) && (!id.equals(OID))) { throw new ConfigurationException( "Start TLS received the following response instead of " + OID + ": " + id); } StartTlsResponse resp = null; ServiceLoader<StartTlsResponse> sl = ServiceLoader.load( StartTlsResponse.class, getContextClassLoader()); Iterator<StartTlsResponse> iter = sl.iterator(); while (resp == null && privilegedHasNext(iter)) { resp = iter.next(); } if (resp != null) { return resp; } try { VersionHelper helper = VersionHelper.getVersionHelper(); @SuppressWarnings("deprecation") Object o = helper.loadClass( "com.sun.jndi.ldap.ext.StartTlsResponseImpl").newInstance(); resp = (StartTlsResponse) o; } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw wrapException(e); } return resp; } /* * Wrap an exception, thrown while attempting to load the StartTlsResponse * class, in a configuration exception. */ private ConfigurationException wrapException(Exception e) { ConfigurationException ce = new ConfigurationException( "Cannot load implementation of javax.naming.ldap.StartTlsResponse"); ce.setRootCause(e); return ce; } /* * Acquire the class loader associated with this thread. */ @SuppressWarnings("removal") private final ClassLoader getContextClassLoader() { PrivilegedAction<ClassLoader> pa = Thread.currentThread()::getContextClassLoader; return AccessController.doPrivileged(pa); } @SuppressWarnings("removal") private static final boolean privilegedHasNext(final Iterator<StartTlsResponse> iter) { PrivilegedAction<Boolean> pa = iter::hasNext; return AccessController.doPrivileged(pa); } private static final long serialVersionUID = 4441679576360753397L; }
⏎ javax/naming/ldap/StartTlsRequest.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, 6439👍, 0💬
Popular Posts:
What Is javax.websocket-api-1.1. jar?javax.websocket-api-1.1. jaris the JAR file for Java API for We...
JDK 8 tools.jar is the JAR file for JDK 8 tools. It contains Java classes to support different JDK t...
Apache Commons Codec library provides implementations of common encoders and decoders such as Base64...
Where to find answers to frequently asked questions on Downloading and Installing ojdbc.jar - JDBC D...
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...