private void GenerateKeys(string seed) { // generate the RSA keypair for the address AsymmetricCipherKeyPair rsaKeyPair = WalletController.GetRSAKeyPairFromSeed(seed); RsaKeyParameters rsaPublicKey = rsaKeyPair.Public as RsaKeyParameters; RsaPublicKey pbk = new RsaPublicKey() { Exponent = rsaPublicKey.Exponent.ToByteArrayUnsigned(), Modulus = rsaPublicKey.Modulus.ToByteArrayUnsigned() }; RsaPrivateCrtKeyParameters rsaPrivateKey = rsaKeyPair.Private as RsaPrivateCrtKeyParameters; RsaPrivateKey prk = new RsaPrivateKey() { DP = rsaPrivateKey.DP.ToByteArrayUnsigned(), DQ = rsaPrivateKey.DQ.ToByteArrayUnsigned(), Exponent = rsaPrivateKey.Exponent.ToByteArrayUnsigned(), Modulus = rsaPrivateKey.Modulus.ToByteArrayUnsigned(), P = rsaPrivateKey.P.ToByteArrayUnsigned(), PublicExponent = rsaPrivateKey.PublicExponent.ToByteArrayUnsigned(), Q = rsaPrivateKey.Q.ToByteArrayUnsigned(), QInv = rsaPrivateKey.QInv.ToByteArrayUnsigned() }; this._testOutputHelper.WriteLine($"Public key: {pbk.ToHex()}"); this._testOutputHelper.WriteLine($"Private key: {prk.ToHex()}"); }