如何访问jvm默认的KeyStore? [英] How to acess jvm default KeyStore?

查看:137
本文介绍了如何访问jvm默认的KeyStore?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java密钥存储来保存密钥和证书。有人可以分享一些代码来帮助我吗?

I want to use java key store to save keys and certificates. can anybody share some code to help me with this?

推荐答案

KeyStore Javadocs页面中应该有足够的示例代码来帮助您开始:

There should be enough example code in the KeyStore Javadocs page to get you started:

  • https://docs.oracle.com/javase/9/docs/api/java/security/KeyStore.html

至于默认密钥库-我不确定这种情况是否存在,通常您可以从文件中显式加载它,也可以使用以下命令对其进行配置系统属性:

As for the 'default' keystore - I'm not sure such a thing exists, normally you either load it explicitly from a file, or you can configure it using the following system properties:


  • javax.net.ssl.keyStore-密钥库位置

  • javax.net。 ssl.keyStorePassword-密钥库密码

  • javax.net.ssl.keyStoreType-密钥库类型(JKS,P12等)

与信任库类似:


  • javax.net.ssl.trustStore

  • javax.net.ssl.trustStorePassword

  • javax.net.ssl .trustStoreType

这篇关于如何访问jvm默认的KeyStore?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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