小编Pet*_*aro的帖子

KeyStore和KeyManager/TrustManager之间的区别

使用密钥库和信任库的KeyStore对象有什么区别; 而不是使用KeyManager和TrustManager?

让我解释一下我的要求.我正在使用RESTEasy,需要通过HTTPS使用SSL证书进行REST调用.我需要增加RESTEasy如何创建ClientRequest.这是我最初想到的:

public void afterPropertiesSet() throws Exception {
    Assert.isTrue(StringUtils.isNotBlank(getKeystoreName()), "Key Store Name is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getKeystorePassword()), "Key Store Password is Blank.");
    Assert.isTrue(StringUtils.isNotBlank(getKeystorePath()), "Key Store Path is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getTruststoreName()), "Trust Store Name is Blank");
    Assert.isTrue(StringUtils.isNotBlank(getTruststorePassword()), "Trust Store Password is Blank.");
    Assert.isTrue(StringUtils.isNotBlank(getTruststorePath()), "Trust Store Path is Blank");

    // Set the keystore and truststore for mutual authentication
    createKeystore();
    createTruststore();

    if (getHttpClient() == null) {
        // Initialize HTTP Client
        initializeHttpClient();
    }

    Assert.notNull(getHttpClient(), "HTTP Client is NULL after initialization");
}

public ClientRequest createClientRequest(String uri) throws …
Run Code Online (Sandbox Code Playgroud)

ssl keystore httpclient truststore

16
推荐指数
1
解决办法
2万
查看次数

标签 统计

httpclient ×1

keystore ×1

ssl ×1

truststore ×1