|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.naming.ldap.StartTlsRequest
public class StartTlsRequest
此類別實作在 Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security 中定義的 StartTLS 的 LDAPv3 擴展請求。 StartTLS 的物件標識符為 1.3.6.1.4.1.1466.20037,沒有定義任何擴展請求值。
使用 StartTlsRequest/StartTlsResponse 在與 JNDI 上下文(對該上下文調用 extendedOperation())關聯的現有 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;
StartTlsResponse,
序列化表格| 欄位摘要 | |
|---|---|
static String |
OID
StartTLS 擴展請求的分派物件標識符為 1.3.6.1.4.1.1466.20037。 |
| 建構子摘要 | |
|---|---|
StartTlsRequest()
建構 StartTLS 擴展請求。 |
|
| 方法摘要 | |
|---|---|
ExtendedResponse |
createExtendedResponse(String id,
byte[] berValue,
int offset,
int length)
創建與 LDAP StartTLS 擴展請求相對應的擴展回應物件。 |
byte[] |
getEncodedValue()
檢索 StartTLS 請求的 ASN.1 BER 編碼值。 |
String |
getID()
檢索 StartTLS 請求的物件標識符字元串。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
public static final String OID
| 建構子詳細資訊 |
|---|
public StartTlsRequest()
| 方法詳細資訊 |
|---|
public String getID()
ExtendedRequest 中的 getIDpublic byte[] getEncodedValue()
ExtendedRequest 中的 getEncodedValue
public ExtendedResponse createExtendedResponse(String id,
byte[] berValue,
int offset,
int length)
throws NamingException
結果必須為 StartTlsResponse 的具體子類別,並且必須具有不帶參數的公共建構子。
此方法通過尋找具有以下名稱的配置檔案來尋找實作類別:
META-INF/services/javax.naming.ldap.StartTlsResponse配置檔案及其相應的實作類別對於調用執行緒的上下文類別載入器而言必須是可存取的。
每個配置檔案應該套件含一個完全限定類別名稱列表,每行一個類別名。忽略各名稱周圍的空格字元和製表符以及空行。註釋字元為 '#' (0x23);將忽略每行第一個註釋字元後面的所有字元。檔案必須使用 UTF-8 編碼。
此方法將返回它能夠從類別名稱列表(通過配置檔案收集)成功載入和實例化的第一個實作類別的實例。此方法使用調用執行緒的上下文類別載入器尋找配置檔案和載入實作類別。
如果使用此方式找不到任何類別,則此方法將使用特定於實作的方式來尋找實作。如果一個也找不到,則拋出 NamingException。
ExtendedRequest 中的 createExtendedResponseid - 擴展回應的物件標識符。其值必須為 "1.3.6.1.4.1.1466.20037" 或 null。兩個值是等價的。berValue - 擴展回應的 ASN.1 BER 編碼值(可能為 null)。此為原始 BER 位元組,包括回應值的標記和長度。它不包括回應 OID。它的值將被忽略,因為不要求 Start TLS 回應包含任何回應值。offset - berValue 中要使用的位元組的開始位置。它的值將被忽略,因為不要求 Start TLS 回應包含任何回應值。length - berValue 中要使用的位元組數。它的值將被忽略,因為不要求 Start TLS 回應包含任何回應值。
NamingException - 如果在創建 StartTLS 擴展回應物件時遇到命名異常。ExtendedResponse
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。