示例#1
0
        private static void InitializeSecureChannelSchema()
        {
            SecureChannelConfig config = new SecureChannelConfig();
            Exception           ex;

            config.SchemaInitializer.Initialize(new ConsoleLogger(), out ex);
            Expect.IsNull(ex);
        }
示例#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);
        }