本文整理匯總了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));
}
示例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);
}
}
示例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;
}
示例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);
}