本文整理汇总了Java中javax.net.ssl.X509ExtendedKeyManager类的典型用法代码示例。如果您正苦于以下问题:Java X509ExtendedKeyManager类的具体用法?Java X509ExtendedKeyManager怎么用?Java X509ExtendedKeyManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
X509ExtendedKeyManager类属于javax.net.ssl包,在下文中一共展示了X509ExtendedKeyManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCertificateChain
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public X509Certificate[] getCertificateChain(final String s) {
return with(new Function<X509Certificate[]>() {
@Override
public X509Certificate[] apply(X509ExtendedKeyManager delegate) {
return delegate.getCertificateChain(s);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例2: engineGetKeyManagers
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
protected final KeyManager[] engineGetKeyManagers() {
List<X509ExtendedKeyManager> delegates = new ArrayList<>();
X509ExtendedKeyManager systemKeyManager = getSystemKeyManager();
if (systemKeyManager != null) {
delegates.add(systemKeyManager);
}
FileWatchingX509ExtendedKeyManager containerKeyManager = getContainerKeyManager();
if (containerKeyManager != null) {
delegates.add(containerKeyManager);
}
return new KeyManager[]{new DelegatingX509ExtendedKeyManager(delegates)};
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:17,代码来源:CloudFoundryContainerKeyManagerFactory.java
示例3: implRun
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
public void implRun() throws SSLException
{
KeyExchangeAlgorithm kexalg = engine.session().suite.keyExchangeAlgorithm();
X509ExtendedKeyManager km = engine.contextImpl.keyManager;
Principal[] issuers = null; // XXX use TrustedAuthorities extension.
keyAlias = km.chooseEngineServerAlias(kexalg.name(), issuers, engine);
if (keyAlias == null)
throw new SSLException("no certificates available");
X509Certificate[] chain = km.getCertificateChain(keyAlias);
engine.session().setLocalCertificates(chain);
localCert = chain[0];
serverKey = km.getPrivateKey(keyAlias);
if (kexalg == DH_DSS || kexalg == DH_RSA)
dhPair = new KeyPair(localCert.getPublicKey(),
km.getPrivateKey(keyAlias));
}
示例4: getX509KeyManager
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
private static X509ExtendedKeyManager getX509KeyManager(KeyManager keyManager) throws StartException {
if (keyManager == null) {
return null;
}
if (keyManager instanceof X509ExtendedKeyManager) {
X509ExtendedKeyManager x509KeyManager = (X509ExtendedKeyManager) keyManager;
if (x509KeyManager instanceof DelegatingKeyManager && IS_FIPS.getAsBoolean()) {
ROOT_LOGGER.trace("FIPS enabled on JVM, unwrapping KeyManager");
// If FIPS is enabled unwrap the KeyManager
x509KeyManager = ((DelegatingKeyManager)x509KeyManager).delegating.get();
}
return x509KeyManager;
}
throw ROOT_LOGGER.invalidTypeInjected(X509ExtendedKeyManager.class.getSimpleName());
}
示例5: CipherTestUtils
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
private CipherTestUtils()
throws IOException, FileNotFoundException, KeyStoreException,
NoSuchAlgorithmException, CertificateException,
UnrecoverableKeyException, InvalidKeySpecException {
factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
KeyStore serverKeyStore = createServerKeyStore(SERVER_PUBLIC_KEY,
SERVER_PRIVATE_KEY);
KeyStore serverTrustStore = createServerKeyStore(CA_PUBLIC_KEY,
CA_PRIVATE_KEY);
if (serverKeyStore != null) {
KeyManagerFactory keyFactory1
= KeyManagerFactory.getInstance(
KeyManagerFactory.getDefaultAlgorithm());
keyFactory1.init(serverKeyStore, PASSWORD);
serverKeyManager = (X509ExtendedKeyManager) keyFactory1.
getKeyManagers()[0];
} else {
serverKeyManager = null;
}
serverTrustManager = serverTrustStore != null
? new AlwaysTrustManager(serverTrustStore) : null;
KeyStore clientKeyStore, clientTrustStore;
clientTrustStore = serverTrustStore;
clientKeyStore =
createServerKeyStore(CLIENT_PUBLIC_KEY,CLIENT_PRIVATE_KEY);
if (clientKeyStore != null) {
KeyManagerFactory keyFactory
= KeyManagerFactory.getInstance(
KeyManagerFactory.getDefaultAlgorithm());
keyFactory.init(clientKeyStore, PASSWORD);
clientKeyManager = (X509ExtendedKeyManager) keyFactory.
getKeyManagers()[0];
} else {
clientKeyManager = null;
}
clientTrustManager = (clientTrustStore != null)
? new AlwaysTrustManager(clientTrustStore) : null;
}
示例6: MyX509ExtendedKeyManager
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
public MyX509ExtendedKeyManager(
X509ExtendedKeyManager akm, String expectedAP, boolean doCheck) {
this.akm = akm;
this.expectedAP = expectedAP;
this.doCheck = doCheck;
}
示例7: chooseClientAlias
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String chooseClientAlias(final String[] strings, final Principal[] principals, final Socket socket) {
return with(new Function<String>() {
@Override
public String apply(X509ExtendedKeyManager delegate) {
return delegate.chooseClientAlias(strings, principals, socket);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例8: chooseEngineClientAlias
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String chooseEngineClientAlias(final String[] strings, final Principal[] principals, final SSLEngine sslEngine) {
return with(new Function<String>() {
@Override
public String apply(X509ExtendedKeyManager delegate) {
return delegate.chooseEngineClientAlias(strings, principals, sslEngine);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例9: chooseEngineServerAlias
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String chooseEngineServerAlias(final String s, final Principal[] principals, final SSLEngine sslEngine) {
return with(new Function<String>() {
@Override
public String apply(X509ExtendedKeyManager delegate) {
return delegate.chooseEngineServerAlias(s, principals, sslEngine);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例10: chooseServerAlias
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String chooseServerAlias(final String s, final Principal[] principals, final Socket socket) {
return with(new Function<String>() {
@Override
public String apply(X509ExtendedKeyManager delegate) {
return delegate.chooseServerAlias(s, principals, socket);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例11: getClientAliases
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String[] getClientAliases(final String s, final Principal[] principals) {
return collect(new Function<String[]>() {
@Override
public String[] apply(X509ExtendedKeyManager delegate) {
return delegate.getClientAliases(s, principals);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例12: getPrivateKey
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public PrivateKey getPrivateKey(final String s) {
return with(new Function<PrivateKey>() {
@Override
public PrivateKey apply(X509ExtendedKeyManager delegate) {
return delegate.getPrivateKey(s);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例13: getServerAliases
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
@Override
public String[] getServerAliases(final String s, final Principal[] principals) {
return collect(new Function<String[]>() {
@Override
public String[] apply(X509ExtendedKeyManager delegate) {
return delegate.getServerAliases(s, principals);
}
});
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:12,代码来源:DelegatingX509ExtendedKeyManager.java
示例14: collect
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
private String[] collect(Function<String[]> function) {
List<String> collected = new ArrayList<>();
for (X509ExtendedKeyManager delegate : this.delegates) {
String[] candidate = function.apply(delegate);
if (candidate != null) {
Collections.addAll(collected, candidate);
}
}
return collected.toArray(new String[collected.size()]);
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:14,代码来源:DelegatingX509ExtendedKeyManager.java
示例15: with
import javax.net.ssl.X509ExtendedKeyManager; //导入依赖的package包/类
private <T> T with(Function<T> function) {
for (X509ExtendedKeyManager delegate : this.delegates) {
T candidate = function.apply(delegate);
if (candidate != null) {
return candidate;
}
}
return null;
}
开发者ID:cloudfoundry,项目名称:java-buildpack-security-provider,代码行数:11,代码来源:DelegatingX509ExtendedKeyManager.java