{"record":{"id":"2a20608210747568","repo":"grafana/k6","slug":"key-import-not-implemented-for-algorithm-name","errorCode":null,"errorMessage":"key import not implemented for algorithm {name}","messagePattern":"key import not implemented for algorithm (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/key.go","lineNumber":286,"sourceCode":"}\n\nfunc newKeyImporter(rt *sobek.Runtime, normalized Algorithm, params sobek.Value) (KeyImporter, error) {\n\tvar ki KeyImporter\n\tvar err error\n\n\tswitch normalized.Name {\n\tcase AESCbc, AESCtr, AESGcm, AESKw:\n\t\tki = newAESImportParams(normalized)\n\tcase HMAC:\n\t\tki, err = newHMACImportParams(rt, normalized, params)\n\tcase ECDH, ECDSA:\n\t\tki, err = newEcKeyImportParams(rt, normalized, params)\n\tcase RSASsaPkcs1v15, RSAPss, RSAOaep:\n\t\tki, err = newRsaHashedImportParams(rt, normalized, params)\n\tcase PBKDF2:\n\t\tki = newPBKDF2ImportParams(normalized)\n\tdefault:\n\t\treturn nil, errors.New(\"key import not implemented for algorithm \" + normalized.Name)\n\t}\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ki, nil\n}\n\n// UsageIntersection returns the intersection of two slices of CryptoKeyUsage.\n//\n// It implements the algorithm described in the [specification] to\n// determine the intersection of two slices of CryptoKeyUsage.\n//\n// [specification]: https://w3c.github.io/webcrypto/#concept-usage-intersection\nfunc UsageIntersection(a, b []CryptoKeyUsage) []CryptoKeyUsage {\n\tvar intersection []CryptoKeyUsage\n","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/webcrypto/key.go#L268-L304","documentation":"Error \"key import not implemented for algorithm {name}\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/key.go:286 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}