{"record":{"id":"12de0fa0696b496d","repo":"grafana/k6","slug":"not-a-crypto-key-pair","errorCode":null,"errorMessage":"not a Crypto Key Pair","messagePattern":"not a Crypto Key Pair","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/key.go","lineNumber":92,"sourceCode":"\t// `CryptoKey` type without having to cast the `Algorithm` field.\n\tAlgorithm any `js:\"algorithm\"`\n\n\t// Usages holds the key usages for which this key can be used.\n\tUsages []CryptoKeyUsage `js:\"usages\"`\n\n\t// handle is an internal slot, holding the underlying key data.\n\t// See [specification](https://www.w3.org/TR/WebCryptoAPI/#dfnReturnLink-0).\n\thandle any\n}\n\n// IsKeyPair .\nfunc (ck *CryptoKey) IsKeyPair() bool {\n\treturn false\n}\n\n// ResolveCryptoKeyPair returns an error since the underlying type is not a CryptoKeyPair.\nfunc (ck *CryptoKey) ResolveCryptoKeyPair() (*CryptoKeyPair, error) {\n\treturn nil, errors.New(\"not a Crypto Key Pair\")\n}\n\n// ResolveCryptoKey returns the underlying CryptoKey.\nfunc (ck *CryptoKey) ResolveCryptoKey() (*CryptoKey, error) {\n\treturn ck, nil\n}\n\n// Validate checks if the key is valid.\nfunc (ck *CryptoKey) Validate() error {\n\tif ck.Type != PrivateCryptoKeyType && ck.Type != PublicCryptoKeyType && ck.Type != SecretCryptoKeyType {\n\t\treturn errors.New(\"invalid key type\")\n\t}\n\n\treturn nil\n}\n\nvar _ CryptoKeyGenerationResult = &CryptoKey{}\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/webcrypto/key.go#L74-L110","documentation":"Error \"not a Crypto Key Pair\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/key.go:92 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"}