我在缓冲区中有公钥和私钥的原始字节,并希望使用该信息来加密/解密数据。
我知道我可以生成一个密钥对使用SecKeyGeneratePair
,然后将其保存到钥匙串。
基本上,我需要以下Java代码的Objective-C等价物(使用Bouncycastle)
BigInteger modulus = ....
BigInteger publicExponent = ....
BigInteger privateExponent = ....
RSAKeyParameters pubKey = new RSAKeyParameters(false, modulus, publicExponent);
RSAKeyParameters privKey = new RSAKeyParameters(true, modulus, privateExponent);
return new AsymmetricCipherKeyPair(pubKey, privKey);
发布于 2018-08-16 10:56:29
我知道OpenSSL允许你这样做,所以你可能想调查将OpenSSL编译到你的项目中。
https://stackoverflow.com/questions/-100000585
复制相似问题