如何在 Websphere Liberty 和 Java 中使用密钥库?
How to use keystore in Websphere Liberty and in Java?
这可能是个愚蠢的问题,但我无法通过谷歌搜索找到解释。
在 Websphere Liberty 8.5
的 server.xml
文件中有设置
<keyStore id="sampleJKSKeyStore"
location="MyKeyStoreFile.jks"
type="JKS" password="myPassword" />
我能用这个密钥库做什么?例如,我能否以编程方式 保存到 和 从 PrivateKey
/ PublicKey
加载,这是我使用以下代码创建的:
final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
final KeyPair key = keyGen.generateKeyPair();
final PrivateKey privateKey1=key.getPrivate();
final PublicKey publickey1=key.getPublic();
提前致谢!
密钥库配置本质上只是告诉 Liberty 配置文件运行时密钥库在哪里以及如何从中获取证书。然后它可以与 httpEndpoint 相关联以存储 https 的证书。 Liberty 运行时还有其他使用它的方法,但这种使用是由运行时而不是应用程序使用的。如果您想让应用程序访问它,您可以提出增强产品的请求 here。
这可能是个愚蠢的问题,但我无法通过谷歌搜索找到解释。 在 Websphere Liberty 8.5
的server.xml
文件中有设置
<keyStore id="sampleJKSKeyStore"
location="MyKeyStoreFile.jks"
type="JKS" password="myPassword" />
我能用这个密钥库做什么?例如,我能否以编程方式 保存到 和 从 PrivateKey
/ PublicKey
加载,这是我使用以下代码创建的:
final KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
final KeyPair key = keyGen.generateKeyPair();
final PrivateKey privateKey1=key.getPrivate();
final PublicKey publickey1=key.getPublic();
提前致谢!
密钥库配置本质上只是告诉 Liberty 配置文件运行时密钥库在哪里以及如何从中获取证书。然后它可以与 httpEndpoint 相关联以存储 https 的证书。 Liberty 运行时还有其他使用它的方法,但这种使用是由运行时而不是应用程序使用的。如果您想让应用程序访问它,您可以提出增强产品的请求 here。