I have the raw bytes of public and private key in a buffer and want to use that information to encrypt / decrypt data.
I do know that I could generate a keypair using SecKeyGeneratePair
and then save it to the keychain, but i don't want that...
essentially, i need the Objective-C equivalent of the following Java Code (using 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);
Any ideas? I'm really stuck on that problem....