因此,由于各种内部原因,我无法对命令属性使用内置在加密中的NService总线,而是将其实现为MessageMutator。我有这样的代码:
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;
}
}这一切都很好,当它们被放入公共汽车时,所有的东西都被加密了。我想要做的是能够在查看消息时解密消息,特别是在查看ServiceInsight应用程序时。我觉得他们提供了IMutateTransportMessages接口,并在他们的站点上提供了这一事实,特别是暗示了这样一个事实:这就是如何实现完整的消息加密;将有一种机制为ServiceInsight创建一个插件来解密它。
发布于 2015-08-26 05:15:46
目前还没有ServiceInsight的插件模型。
您可以做的是从ServiceInsight复制加密的值,并编写一个工具为您解密。
https://stackoverflow.com/questions/32210676
复制相似问题