pub async fn import_secret_key_jwk(
variant: EcdhVariant,
jwk: String,
options: AgreementKeyOptions,
) -> Result<SecretKey, Error>Expand description
Import a static secret key as an EC private JWK (kty: "EC",
with crv, d, and the public coordinates x/y, which RFC
7518 makes mandatory — this is inherently the public+private
form). jwk is the JWK as JSON text; see mac-key.export-key-jwk
for the package-wide JWK contract, including ext validation
against the options’ extractability. d is the curve’s scalar
and must lie in [1, n-1] (error.invalid-key otherwise).
Security:
- Implementations MAY reject a JWK whose
x/yis not the public point ofdwitherror.invalid-key, and MUST NOT trustx/yfor any operation: the imported key’s identity isd’s. (The W3C Web Cryptography API’s import steps do not mandate the consistency check, and engines differ, so a platform-backed host cannot promise it.)