(
ctx: &Ctx<'js>,
format: KeyFormatData<'js>,
kind: &mut KeyKind,
data: &mut Vec<u8>,
algorithm_name: &str,
)
| 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)?; |
no test coverage detected