如果需要,您仍然可以加载密钥,
public static PublicKey bigIntegerToPublicKey(BigInteger e, BigInteger m) { RSAPublicKeySpec keySpec = new RSAPublicKeySpec(m, e); KeyFactory fact = KeyFactory.getInstance("RSA"); PublicKey pubKey = fact.generatePublic(keySpec); return pubKey;}public static PrivateKey bigIntegerToPrivateKey(BigInteger e, BigInteger m) { RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(m, e); KeyFactory fact = KeyFactory.getInstance("RSA"); PrivateKey privKey = fact.generatePrivate(keySpec); return privKey;}
您所需要的只是模数和指数。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)