{"record":{"id":"9a3376946a195404","repo":"grafana/k6","slug":"not-a-cryptokey","errorCode":null,"errorMessage":"not a CryptoKey","messagePattern":"not a CryptoKey","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/key.go","lineNumber":50,"sourceCode":"\n\t// PublicKey holds the public key. For encryption and decryption algorithms,\n\t// this key is used to encrypt. For signing and verification algorithms it is used to verify.\n\tPublicKey *CryptoKey `js:\"publicKey\"`\n}\n\n// IsKeyPair .\nfunc (ckp *CryptoKeyPair) IsKeyPair() bool {\n\treturn true\n}\n\n// ResolveCryptoKeyPair returns the underlying CryptoKeyPair.\nfunc (ckp *CryptoKeyPair) ResolveCryptoKeyPair() (*CryptoKeyPair, error) {\n\treturn ckp, nil\n}\n\n// ResolveCryptoKey returns an error since the underlying type is not a CryptoKey.\nfunc (ckp *CryptoKeyPair) ResolveCryptoKey() (*CryptoKey, error) {\n\treturn nil, errors.New(\"not a CryptoKey\")\n}\n\nvar _ CryptoKeyGenerationResult = &CryptoKeyPair{}\n\n// CryptoKey represents a cryptographic key obtained from one of the SubtleCrypto\n// methods `SubtleCrypto.generateKey`, `SubtleCrypto.DeriveKey`, `SubtleCrypto.ImportKey`,\n// or `SubtleCrypto.UnwrapKey`.\ntype CryptoKey struct {\n\t// Type holds the type of the key.\n\tType CryptoKeyType `js:\"type\"`\n\n\t// Extractable indicates whether or not the key may be extracted\n\t// using `SubtleCrypto.ExportKey` or `SubtleCrypto.WrapKey`.\n\t//\n\t// If the value is `true`, the key may be extracted.\n\t// If the value is `false`, the key may not be extracted, and\n\t// `SubtleCrypto.exportKey` and `SubtleCrypto.wrapKey` will fail.\n\tExtractable bool `js:\"extractable\"`","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/webcrypto/key.go#L32-L68","documentation":"Error \"not a CryptoKey\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/key.go:50 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"}