Skip to main content

import_key_jwk

Function import_key_jwk 

Source
pub async fn import_key_jwk(
    variant: AesVariant,
    jwk: String,
    options: AeadKeyOptions,
) -> Result<AeadKey, Error>
Expand description

Import an RFC 7517 JSON Web Key as an AES-GCM key of the declared variant.

jwk is the JWK as JSON text; the implementation owns the parse (see README.md, “JWK contract”). The key must be an oct key whose alg, if present, names the declared variant ("A128GCM"/"A192GCM"/"A256GCM"); the decoded material is then subject to import-key-raw’s contract.