internal KeyVaultPlugin(string encryptionSecretName, ISecretManager secretManager) { this.secretName = encryptionSecretName; this.secretManager = secretManager; this.initializationVector = KeyVaultPlugin.GenerateInitializationVector(); this.base64InitializationVector = Convert.ToBase64String(this.initializationVector); }
/// <summary> /// Creates a new instance of an <see cref="KeyVaultPlugin"/>. /// </summary> /// <param name="encryptionSecretName">The name of the secret used to encrypt / decrypt messages.</param> /// <param name="options">The <see cref="KeyVaultPluginSettings"/> used to create a new instance.</param> public KeyVaultPlugin(string encryptionSecretName, KeyVaultPluginSettings options) { if (string.IsNullOrEmpty(encryptionSecretName)) { throw new ArgumentNullException(nameof(encryptionSecretName)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } this.secretName = encryptionSecretName; this.keyVaultEndpoint = options.Endpoint; this.secretManager = new KeyVaultSecretManager(options.Endpoint, options.ClientId, options.ClientSecret); this.initializationVector = KeyVaultPlugin.GenerateInitializationVector(); this.base64InitializationVector = Convert.ToBase64String(this.initializationVector); }