/// <summary> /// Wraps a symmetric key using the specified wrapping key and algorithm. /// </summary> /// <param name="wrappingKey">The wrapping key</param> /// <param name="key">The key to wrap</param> /// <param name="algorithm">The algorithm to use</param> /// <returns>The wrapped key</returns> public static async Task <KeyOperationResult> WrapKeyAsync(this KeyVaultClient client, KeyBundle wrappingKey, byte[] key, string algorithm) { if (wrappingKey == null) { throw new ArgumentNullException("keyBundle"); } return(await client.WrapKeyAsync(wrappingKey.Key, key, algorithm).ConfigureAwait(false)); }
/// <summary> /// Wraps a symmetric key using the specified wrapping key and algorithm. /// </summary> /// <param name="wrappingKey">The wrapping key</param> /// <param name="key">The key to wrap</param> /// <param name="algorithm">The algorithm to use</param> /// <returns>The wrapped key</returns> public static async Task <KeyOperationResult> WrapKeyAsync(this KeyVaultClient client, JsonWebKey wrappingKey, byte[] key, string algorithm) { KeyOperationResult result = null; if (wrappingKey == null) { throw new ArgumentNullException("wrappingKey"); } if (key == null) { throw new ArgumentNullException("key"); } return(await client.WrapKeyAsync(wrappingKey.Kid, algorithm, key).ConfigureAwait(false)); }