You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: web_sys.rs
    path of file: ./repos/tunshell/tunshell-client/src/stream/crypto
    
    the code of the file until where you have to start completion: use super::super::EncryptedMessage;
use anyhow::{Error, Result};
use futures::Future;
use js_sys::{Array, JsString, Uint8Array};
use wasm_bindgen::{JsCast, JsValue};
use wasm_bindgen_futures::JsFuture;
use web_sys::{AesDerivedKeyParams, AesGcmParams, Crypto, CryptoKey, Pbkdf2Para
    
async fn import_key(key: &[u8]) -> Result<CryptoKey> {
    let key_material = {
        let promise = crypto()?
            .subtle()
            .import_key_with_str(
                "raw",
                &Uint8Array::from(key),
                "PBKDF2",
                false,
                &Array::of2(&JsString::from("deriveBits"), &JsString::from("deriveKey")),
            )
            .map_err(|err| Error::msg(format!("failed to import key: {:?}", err)))?;

        JsFuture::from(promise)
    };

    let key_material = CryptoKey::unchecked_from_js(
        key_material
            .await
            .map_err(|err| Error::msg(format!("failed to import key: {:?}", err)))?,
    );

    Ok(key_material)
}