import_key

Function import_key 

Source
pub(crate) fn import_key(
    aes_algorithm: AesAlgorithm,
    global: &GlobalScope,
    format: KeyFormat,
    key_data: &[u8],
    extractable: bool,
    usages: Vec<KeyUsage>,
    can_gc: CanGc,
) -> Result<DomRoot<CryptoKey>, Error>
Expand description

https://w3c.github.io/webcrypto/#aes-ctr-operations-import-key https://w3c.github.io/webcrypto/#aes-cbc-operations-import-key https://w3c.github.io/webcrypto/#aes-gcm-operations-import-key https://w3c.github.io/webcrypto/#aes-kw-operations-import-key https://wicg.github.io/webcrypto-modern-algos/#aes-ocb-operations-import-key

The specification of AES-OCB has one more step at the beginning of the operation:

Let keyData be the key data to be imported.

As it is simply used to name the variable, it is safe to omit it in the implementation below to align with the specification of other AES algorithms.