當前位置: 首頁>>代碼示例>>Java>>正文


Java X509KeyManager.chooseClientAlias方法代碼示例

本文整理匯總了Java中javax.net.ssl.X509KeyManager.chooseClientAlias方法的典型用法代碼示例。如果您正苦於以下問題:Java X509KeyManager.chooseClientAlias方法的具體用法?Java X509KeyManager.chooseClientAlias怎麽用?Java X509KeyManager.chooseClientAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.net.ssl.X509KeyManager的用法示例。


在下文中一共展示了X509KeyManager.chooseClientAlias方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testCardProvider

import javax.net.ssl.X509KeyManager; //導入方法依賴的package包/類
@Test
@Ignore
public void testCardProvider() throws GeneralSecurityException, CardException {
    DelegatingProvider cp = DelegatingProvider.fromDelegate(CardDelegate.any(false, CONSOLE));
    Assume.assumeNotNull(cp);

    Security.insertProviderAt(cp, 0);
    X509KeyManager km = cp.getKeyManager();

    String alias = km.chooseClientAlias(new String[]{"RSA"}, null, null);
    PrivateKey pk = km.getPrivateKey(alias);
    Signature s = Signature.getInstance("SHA256withRSA");
    s.initSign(pk);
    s.update(HexUtils.hex2bin("311fe3feed16b9cd8df0f8b1517be5cb86048707df4889ba8dc37d4d68866d02"));
    byte[] result = s.sign();
    System.out.println(HexUtils.bin2hex(result));
}
 
開發者ID:martinpaljak,項目名稱:esteidhacker,代碼行數:18,代碼來源:TestCardProvider.java

示例2: chooseClientAlias

import javax.net.ssl.X509KeyManager; //導入方法依賴的package包/類
@Override
public String chooseClientAlias(final String[] keyType, final Principal[] issuers, final Socket socket) {
    for (final X509KeyManager keyManager : keyManagers) {
        final String alias = keyManager.chooseClientAlias(keyType, issuers, socket);
        if (alias != null) {
            return alias;
        }
    }
    return null;
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:11,代碼來源:FileTrustStoreSslSocketFactory.java

示例3: chooseClientAlias

import javax.net.ssl.X509KeyManager; //導入方法依賴的package包/類
@Override
public String chooseClientAlias(
        X509KeyManager keyManager, X500Principal[] issuers, String[] keyTypes) {
    if (keyManager instanceof X509ExtendedKeyManager) {
        X509ExtendedKeyManager ekm = (X509ExtendedKeyManager) keyManager;
        return ekm.chooseEngineClientAlias(keyTypes, issuers, this);
    } else {
        return keyManager.chooseClientAlias(keyTypes, issuers, null);
    }
}
 
開發者ID:google,項目名稱:conscrypt,代碼行數:11,代碼來源:ConscryptEngine.java

示例4: chooseClientAlias

import javax.net.ssl.X509KeyManager; //導入方法依賴的package包/類
/**
 * Chooses the first non-null client alias returned from the delegate {@link X509TrustManagers},
 * or {@code null} if there are no matches.
 */
@Override
public @Nullable String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket){
	for (List<X509KeyManager> keyManagers : keyManagers.values()) {
		for (X509KeyManager x509KeyManager : keyManagers) {
			String alias = x509KeyManager.chooseClientAlias(keyType, issuers, socket);
			if (alias != null) {
				return alias;
			}
		}
	}
	return null;
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:17,代碼來源:CompositeX509KeyManager.java

示例5: chooseClientAlias

import javax.net.ssl.X509KeyManager; //導入方法依賴的package包/類
@Override
public final String chooseClientAlias(X509KeyManager keyManager, X500Principal[] issuers,
        String[] keyTypes) {
    return keyManager.chooseClientAlias(keyTypes, issuers, this);
}
 
開發者ID:google,項目名稱:conscrypt,代碼行數:6,代碼來源:ConscryptFileDescriptorSocket.java


注:本文中的javax.net.ssl.X509KeyManager.chooseClientAlias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。