Exemplo n.º 1
0
        public static TwoWayRsaPair FromString(string input)
        {
            var retv = new TwoWayRsaPair();

            retv.SetFromString(input);
            return(retv);
        }
Exemplo n.º 2
0
        public static (TwoWayRsaPair, TwoWayRsaPair) Generate()
        {
            var RSA1 = new RSACryptoServiceProvider();
            var RSA2 = new RSACryptoServiceProvider();

            var Keypair1 = new TwoWayRsaPair {
                EncryptionKey = RSA1.ExportCspBlob(false),
                DecryptionKey = RSA2.ExportCspBlob(true),
            };

            var Keypair2 = new TwoWayRsaPair {
                EncryptionKey = RSA2.ExportCspBlob(false),
                DecryptionKey = RSA1.ExportCspBlob(true),
            };

            return(Keypair1, Keypair2);
        }
Exemplo n.º 3
0
 public TwoWayRsaEncryptor(TwoWayRsaPair keypair)
 {
     KeyPair = keypair;
 }