StartTlsRequest (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../../java.base/java/io/Serializable.html "interface in java.io"), [ExtendedRequest](ExtendedRequest.html "interface in javax.naming.ldap")


public class StartTlsRequest extends Object implements ExtendedRequest

This class implements the LDAPv3 Extended Request for StartTLS as defined inLightweight Directory Access Protocol (v3): Extension for Transport Layer Security The object identifier for StartTLS is 1.3.6.1.4.1.1466.20037 and no extended request value is defined.

StartTlsRequest/StartTlsResponse are used to establish a TLS connection over the existing LDAP connection associated with the JNDI context on which extendedOperation() is invoked. Typically, a JNDI program uses these classes as follows.

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;

Since:

1.4

See Also:

StartTlsResponse, Serialized Form

Fields

Modifier and Type Field Description
static String OID The StartTLS extended request's assigned object identifier is 1.3.6.1.4.1.1466.20037.

Constructors

Constructor Description
StartTlsRequest() Constructs a StartTLS extended request.
Modifier and Type Method Description
ExtendedResponse createExtendedResponse​(String id, byte[] berValue, int offset, int length) Creates an extended response object that corresponds to the LDAP StartTLS extended request.
byte[] getEncodedValue() Retrieves the StartTLS request's ASN.1 BER encoded value.
String getID() Retrieves the StartTLS request's object identifier string.

Methods declared in class java.lang.Object

[clone](../../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../../java.base/java/lang/Object.html#wait%28long,int%29)