使用基于 Java Key Store 中的别名的单个证书 [英] Using a single certificate based on aliases from Java Key Store

查看:30
本文介绍了使用基于 Java Key Store 中的别名的单个证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个密钥库,其中添加了多个密钥和证书我想使用基于密钥库中别名的证书并将其用于 SSL我尝试设置以下系统属性,但没有任何帮助

I have a keystore which has multiple keys and certificates added to it I want to used a certificate based on the aliases from the key store and use it for SSL I tried to set the following System properties but nothing helped

System.setProperty("javax.net.ssl.keyAlias", "abcd");
System.setProperty("javax.net.ssl.keyStoreAlias", "abcd");

它总是使用密钥库中的第一个证书,而不是匹配密钥别名

It always uses the first certificate from the keystore instead of matching the key aliases

推荐答案

如果你看看 JSSE 参考指南的自定义部分(或整个指南),没有 javax.net.ssl.keyAliasjavax.net.ssl.keyStoreAlias 属性.

If you look at the Customization section of the JSSE Reference Guide (or the entire guide), there's no javax.net.ssl.keyAlias or javax.net.ssl.keyStoreAlias property.

应用程序可以使用别名来选择它想要的证书,但它必须自己显式加载它.一些框架使用自己的属性或配置选项.

It's up to the application to have a way to select which certificate it wants, using its alias name, but it has to load it explicitly itself. Some frameworks use their own properties or configuration options.

这篇关于使用基于 Java Key Store 中的别名的单个证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆