MCPcopy Create free account
hub / github.com/awslabs/llrt / import_derive_key

Function import_derive_key

modules/llrt_crypto/src/subtle/key_algorithm.rs:960–978  ·  view source on GitHub ↗
(
    ctx: &Ctx<'js>,
    format: KeyFormatData<'js>,
    kind: &mut KeyKind,
    data: &mut Vec<u8>,
    algorithm_name: &str,
)

Source from the content-addressed store, hash-verified

958
959 let hash_obj = create_hash_object(ctx, hash)?;
960 obj.set("hash", hash_obj)?;
961
962 obj.set("modulusLength", modulus_length)?;
963 obj.set("publicExponent", array)?;
964 },
965 KeyAlgorithm::Derive(KeyDerivation::Hkdf { hash, salt, info }) => {
966 let salt = TypedArray::<u8>::new(ctx.clone(), salt.to_vec())?;
967 let info = TypedArray::<u8>::new(ctx.clone(), info.to_vec())?;
968
969 obj.set("hash", hash.as_str())?;
970 obj.set("salt", salt)?;
971 obj.set("info", info)?;
972 },
973 KeyAlgorithm::Derive(KeyDerivation::Pbkdf2 {
974 hash,
975 salt,
976 iterations,
977 }) => {
978 let salt = TypedArray::<u8>::new(ctx.clone(), salt.to_vec())?;
979 obj.set("hash", hash.as_str())?;
980 obj.set("salt", salt)?;
981 obj.set("iterations", iterations)?;

Callers 1

importFunction · 0.85

Calls 2

into_bytesMethod · 0.80
concatMethod · 0.80

Tested by

no test coverage detected