public void ShouldEncryptAndDecrypt()
        {
            var tripleDESInterceptor = new TripleDESInterceptor(Convert.FromBase64String("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), Convert.FromBase64String("aaaaaaaaaaa="));
            var body       = Encoding.UTF8.GetBytes("haha");
            var rawMessage = new RawMessage(new MessageProperties(), body);

            Assert.AreEqual(body, tripleDESInterceptor.OnConsume(tripleDESInterceptor.OnProduce(rawMessage)).Body);
        }
Esempio n. 2
0
        public void ShouldEncryptAndDecrypt()
        {
            var interceptor     = new TripleDESInterceptor(Convert.FromBase64String("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), Convert.FromBase64String("aaaaaaaaaaa="));
            var body            = Encoding.UTF8.GetBytes("haha");
            var outgoingMessage = new ProducedMessage(new MessageProperties(), body);
            var message         = interceptor.OnProduce(outgoingMessage);
            var incomingMessage = new ConsumedMessage(null, message.Properties, message.Body);

            Assert.Equal(body, interceptor.OnConsume(incomingMessage).Body);
        }