コード例 #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.");
        }