java 密钥保存在哪里_如何在Java Keystore中存储Bouncy Castle PGP密钥?

探讨了将PGP密钥存储在Java密钥存储区的可能性。由于OpenPGP标准与X.509不兼容,直接存储PGP密钥在Java密钥存储区中存在困难。文章讨论了一种通过使用BouncyCastle库来实现这一目标的方法。
摘要由CSDN通过智能技术生成

I’d like to simply store the PGP keys in the existing Keystore. I’ve read several responses on Stackoverflow alluding to it being possible, but no definitive answer about how. So can I store the PGP keys in the existing Keystore?

Java密钥存储区不支持OpenPGP密钥. OpenPGP是另一个与X.509不兼容的标准.

Bouncy Castle’s classes for PGP do not implement Key or Certificate. It does have JcaPGPKeyPair which can wrap a PrivateKey/PublicKey instance. So I could create keys within JCE, then “import” the JCE keys into the BC PGP infrastructure using JcaPGPKeyPair. Once I’m done I throw away all of the BC PGP instances and recreate when I need them again. Possibly using JcaPGPKeyConverter to do the heavy lifting of converting between JCE keys and PGP keys?

Could I use 2 JCE RSA or DSA keypairs for both signature and encryption keys PGP wants to use? Keep those in the Keystore and simply reconstruct the PGP infrastructure on demand when I want to use those keys?

您可能会提取出构成公钥和私钥的纯数字,但是会丢失有关用户ID,时间戳等的所有信息,而这些信息每次都必须重新构造.我不会选择这种脆弱且容易出错的路径.没有真正的OpenPGP和X.509密钥属性映射,并且对于证书(密钥上的签名)而言,情况更糟.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值