/// <summary> /// Serialize messages using the BSON message serializer with AES Encryption /// </summary> /// <param name="configurator"></param> /// <param name="keyProvider"> /// The custom key provider to provide the symmetric key for encryption of plaintext message and decryption of ciphertext message /// </param> public static void UseEncryption(this IEventHubFactoryConfigurator configurator, ISecureKeyProvider keyProvider) { var streamProvider = new AesCryptoStreamProviderV2(keyProvider); configurator.UseEncryptedSerializerV2(streamProvider); }
public AesCryptoStreamProviderV2(ISecureKeyProvider secureKeyProvider, PaddingMode paddingMode = PaddingMode.PKCS7) { _secureKeyProvider = secureKeyProvider; _paddingMode = paddingMode; }
/// <summary> /// Serialize messages using the BSON message serializer with AES Encryption /// </summary> /// <param name="configurator"></param> /// <param name="keyProvider">The custom key provider to provide the symmetric key for encryption of plaintext message and decryption of ciphertext message</param> public static void UseEncryption(this IReceiveEndpointConfigurator configurator, ISecureKeyProvider keyProvider) { var streamProvider = new AesCryptoStreamProviderV2(keyProvider); configurator.UseEncryptedSerializerV2(streamProvider); }
public static void UseEncryption(ISecureKeyProvider keyProvider) { _streamProvider = new AesCryptoStreamProviderV2(keyProvider); _useEncryption = true; }