Class StartTlsRequest
Class StartTlsRequest
public class StartTlsRequest
extends Object
implements ExtendedRequest
이 클래스는 "Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security"에 정의된 StartTLS에 대한 LDAPv3 Extended Request를 구현해요. StartTLS의 객체 식별자는 1.3.6.1.4.1.1466.20037이고 정의된 확장 요청 값은 없어요. StartTlsRequest/StartTlsResponse는 extendedOperation()이 호출되는 JNDI 컨텍스트와 연관된 기존 LDAP 연결 위에 TLS 연결을 수립하는 데 사용돼요. 일반적으로 JNDI 프로그램은 이 클래스들을 다음과 같이 사용해요.
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;
OID
public static final String OID
StartTLS 확장 요청의 할당된 객체 식별자는 1.3.6.1.4.1.1466.20037이에요.
- See Also: 상수 필드 값(Constant Field Values)
StartTlsRequest
public StartTlsRequest()
StartTLS 확장 요청을 생성해요.
getID
public String getID()
StartTLS 요청의 객체 식별자 문자열을 가져와요.
- Specified by:
ExtendedRequest인터페이스의getID - Returns: 객체 식별자 문자열
"1.3.6.1.4.1.1466.20037"
getEncodedValue
public byte[] getEncodedValue()
StartTLS 요청의 ASN.1 BER 인코딩 값을 가져와요. 요청에 정의된 값이 없으므로 항상 null이 반환돼요.
- Specified by:
ExtendedRequest인터페이스의getEncodedValue - Returns: null 값
createExtendedResponse
public ExtendedResponse createExtendedResponse(String id,
byte[] berValue,
int offset,
int length)
throws NamingException
LDAP StartTLS 확장 요청에 해당하는 확장 응답 객체를 만들어요. 결과는 StartTlsResponse의 구체적(concrete) 하위 클래스여야 하고 인자를 받지 않는 public 생성자를 가져야 해요. 이 메서드는 다음 이름의 구성 파일을 찾아 구현 클래스를 찾아내요.
META-INF/services/javax.naming.ldap.StartTlsResponse
구성 파일과 그에 해당하는 구현 클래스는 호출 스레드의 컨텍스트 클래스 로더가 접근할 수 있어야 해요. 각 구성 파일은 완전히 정규화된 클래스 이름 목록을 한 줄에 하나씩 포함해야 해요. 각 이름을 둘러싼 공백·탭 문자와 빈 줄은 무시돼요. 주석 문자는 '#'(0x23)이에요. 각 줄에서 첫 번째 주석 문자 뒤의 모든 문자는 무시돼요. 파일은 UTF-8로 인코딩되어야 해요. 이 메서드는 구성 파일들에서 수집한 클래스 이름 목록에서 성공적으로 로드·인스턴스화할 수 있는 첫 번째 구현 클래스의 인스턴스를 반환할 거예요. 이 메서드는 호출 스레드의 컨텍스트 클래스 로더를 사용해 구성 파일을 찾고 구현 클래스를 로드해요. 이런 방식으로 클래스를 찾을 수 없으면 이 메서드는 구현별 방식으로 구현을 찾아요. 찾지 못하면 NamingException이 던져져요.
- Specified by:
ExtendedRequest인터페이스의createExtendedResponse - Parameters: id - 확장 응답의 객체 식별자. 값은
"1.3.6.1.4.1.1466.20037"또는 null이어야 해요. 두 값은 동등해요 - Returns: StartTLS 확장 응답 객체
- Throws: NamingException - StartTLS 확장 응답 객체를 만드는 동안 네이밍 예외가 발생했을 때
- See Also: ExtendedResponse