Particular ServiceInsight Handling Encrypted Messages via MessageMutator

89 views Asked by At

So for various internal reasons, I wasn't able to use NService Bus' built in encryption for command properties and instead had to implement it as a MessageMutator. I have code that looks like this:

public class TransportMessageEncryptionMutator : IMutateTransportMessages
{
    // Encryption helper is intialized with key stored in Key Vault.
    private readonly EncryptionHelper encryptionHelper;
    public void MutateOutgoing(LogicalMessage logicalMessage, TransportMessage transportMessage)
    {
        var encryptedBody = this.encryptionHelper.EncryptBytes(transportMessage.Body);

        // Set the body of the message to be the encrypted copy of the data.
        transportMessage.Body = encryptedBody;
    }

    public void MutateIncoming(TransportMessage transportMessage)
    {
        // Decrypt the body of the message.
        var clearBody = this.encryptionHelper.DecryptBytes(transportMessage.Body);

        // Set the body of the message to be the decrypted copy of the data and clear flag.
        transportMessage.Body = clearBody;
    }
}

That's all working well and things are encrypted when they're put in the bus. What I'm trying to do is be able to decrypt the message when they're viewed in Particular's ServiceInsight application. I feel like the fact that they provide the IMutateTransportMessages interface and on their site, specifically allude to the fact that this is how to implement full message encryption; that there would be a mechanism to create a plugin for ServiceInsight to decrypt it.

1

There are 1 answers

0
Cameron MacFarland On BEST ANSWER

Currently there's no plugin model for ServiceInsight.

What you could do is copy the encrypted value from ServiceInsight and write a tool to decrypt it for you.