{"record":{"id":"149a7f44987e5bd3","repo":"grafana/k6","slug":"public-exponent-too-large","errorCode":null,"errorMessage":"public exponent too large","messagePattern":"public exponent too large","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/webcrypto/rsa.go","lineNumber":154,"sourceCode":"\n\treturn &CryptoKeyPair{\n\t\tPrivateKey: privateKey,\n\t\tPublicKey:  publicKey,\n\t}, nil\n}\n\n// validatePublicExponent validates the public exponent.\n// it's done same way how golang's rsa package does it + additional check for evenness.\nfunc validatePublicExponent(e int) error {\n\tif e%2 == 0 {\n\t\treturn errors.New(\"public exponent is even\")\n\t}\n\n\tif e < 2 {\n\t\treturn errors.New(\"public exponent too small\")\n\t}\n\tif e > 1<<31-1 {\n\t\treturn errors.New(\"public exponent too large\")\n\t}\n\n\treturn nil\n}\n\nfunc generateRSAKeyPair(\n\tmodulusLength int,\n\tpublicExponent int,\n) (any, any, error) {\n\tprivateKey, err := rsa.GenerateKey(rand.Reader, modulusLength)\n\tif err != nil {\n\t\treturn nil, nil, NewError(OperationError, \"could not generate RSA key pair\")\n\t}\n\n\tprivateKey.E = publicExponent\n\n\t// validate the key pair, since we are setting the public exponent manually\n\tif err := privateKey.Validate(); err != nil {","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/webcrypto/rsa.go#L136-L172","documentation":"Error \"public exponent too large\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/webcrypto/rsa.go:154 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"}