コード例 #1
0
    /// <summary>
    /// Configures Rebus to encrypt outgoing messages and be able to decrypt incoming messages using custom encryption provider.
    /// Please note that it's only the message bodies that are encrypted, thus everything included in the message headers will be visible to eavesdroppers.
    /// Custom encrypotion providers are configured by building on the returned configurer, e.g. like so:
    /// <code>
    /// Configure.With(...)
    ///     .(...)
    ///     .Options(o => {
    ///         o.EnableCustomEncryption()
    ///             .Use***();
    ///     })
    ///     .Start();
    /// </code>
    /// </summary>
    public static StandardConfigurer <IEncryptor> EnableCustomEncryption(this OptionsConfigurer configurer)
    {
        configurer.EnableCustomAsyncEncryption().Register(c => new DefaultAsyncEncryptor(c.Get <IEncryptor>()));

        return(StandardConfigurer <IEncryptor> .GetConfigurerFrom(configurer));
    }