Exemplo n.º 1
0
        public void encryptUsingPublicKeyAndDoesNotDecryptUsingDifferentPrivateKey()
        {
            AsymmetricCryptography asymmetricCryptographyOther = new AsymmetricCryptography();
            Encryption             encryption = new Encryption();

            byte[] encryptedText = encryption.encrypt(TEXT, asymmetricCryptography.getPublicKey());
            encryption.decryption(encryptedText, asymmetricCryptographyOther.getPrivateKey());
        }
Exemplo n.º 2
0
        public void encryptUsingPublicKeyAndDecryptUsingPrivateKey()
        {
            Encryption encryption = new Encryption();

            byte[] encryptedText = encryption.encrypt(TEXT, asymmetricCryptography.getPublicKey());
            string dectyptedText = encryption.decryption(encryptedText, asymmetricCryptography.getPrivateKey());

            Assert.AreEqual(TEXT, dectyptedText);
        }