Situation
Hi, I am using the bouncy castle API in my .NET project. Until now i can generate randomly the private and public keys using
RsaKeyPairGenerator g = new RsaKeyPairGenerator();
g.Init(new KeyGenerationParameters(new SecureRandom(), 1024));
AsymmetricCipherKeyPair keys = g.GenerateKeyPair();
privateKey = keys.Private;
publicKey = keys.Public;
I can encrypt/decrypt byte[]
as well.
Question How can i save the keys into a File ? and how can I import them to after saving them?