Esempio n. 1
0
        public void RsaHelperDecryptedStringShouldMatchOriginalValue()
        {
            var directory = TestContext.DeploymentDirectory;
            var helper = new RsaHelper(Path.Combine(directory, "TestCertificate.pfx"), CertificatePassword);
            var result = helper.RsaEncryptString(TestString);

            var decryptedValue = helper.RsaDecryptToString(result);
            decryptedValue.ShouldBeEquivalentTo(TestString, "Because the rsa decryption failed.");
        }
Esempio n. 2
0
        public void RsaHelperEncryptStringShouldSucceed()
        {
            var directory = TestContext.DeploymentDirectory;
            var helper = new RsaHelper(Path.Combine(directory, "TestCertificate.pfx"), CertificatePassword);
            var result = helper.RsaEncryptString(TestString);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Length > 0);
        }