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密钥属性映射,并且对于证书(密钥上的签名)而言,情况更糟.