예제 #1
0
        public void ShouldBeAbleToEncryptAndDecryptWithSecureSession()
        {
            InitializeSecureChannelSchema();

            SecureSession testObject = SecureSession.Get(new ServiceProxyTestHelpers.FormUrlEncodedTestRequest(), A.Fake <IResponse>());
            string        data       = "Monkey";
            string        cipher     = testObject.EncryptWithPublicKey(data);
            string        decrypted  = testObject.DecryptWithPrivateKey(cipher);

            Expect.AreEqual(data, decrypted);
        }
예제 #2
0
        public void Securesession_ShouldBeAbleToEncryptAndDecryptWithSecureSession()
        {
            SecureChannelConfig config = new SecureChannelConfig();
            Exception           ex;

            config.SchemaInitializer.Initialize(new ConsoleLogger(), out ex);
            Expect.IsNull(ex);

            SecureSession testObject = SecureSession.Get(new ServiceProxyTestHelpers.FormUrlEncodedTestRequest(), A.Fake <IResponse>());
            string        data       = "Monkey";
            string        cipher     = testObject.EncryptWithPublicKey(data);
            string        decrypted  = testObject.DecryptWithPrivateKey(cipher);

            Expect.AreEqual(data, decrypted);
        }