[英]How to create a BCRSAPrivateCrtKey object using CRT parameters?
For my CA there is a database running in the background storing RSA keys by their CRT parameters. 对于我的CA,有一个数据库在后台运行,并通过其CRT参数存储RSA密钥。 Now a
BCRSAPrivateCrtKey
object shall be created by using the stored information in the database. 现在,将通过使用数据库中存储的信息来创建
BCRSAPrivateCrtKey
对象。
Hopefully you can help. 希望您能提供帮助。
So is there any way to create a key object by using: 因此,有什么方法可以使用以下方法创建密钥对象:
RSAPrivateCrtKeyParameters param = new RSAPrivateCrtKeyParameters(modulus,
publicExponent, privateExponent, p, q, dP, dQ, qInv);
RSAPrivateCrtKeySpec prvkeySpec = new RSAPrivateCrtKeySpec(
modulus, publicExponent, privateExponent, primeP,
primeQ, primeExponentP, primeExponentQ,
crtCoefficient);
Security.addProvider(new org.bouncycastle.jce
.provider.BouncyCastleProvider());
KeyFactory kfact = KeyFactory.getInstance("RSA", "BC");
BCRSAPrivateCrtKey prk = (BCRSAPrivateCrtKey) kfact
.generatePrivate(prvkeySpec);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.