Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Generate OKPKeys: TypeError [ERR_INVALID_ARG_TYPE] #48

Closed
2 tasks done
kareha opened this issue Oct 4, 2019 · 1 comment
Closed
2 tasks done

bug: Generate OKPKeys: TypeError [ERR_INVALID_ARG_TYPE] #48

kareha opened this issue Oct 4, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@kareha
Copy link

kareha commented Oct 4, 2019

Describe the bug
When I want to create OKP Keys I get an error:

TypeError [ERR_INVALID_ARG_TYPE]: The "options" argument must be of type object. Received type undefined
    at check (internal/crypto/keygen.js:163:11)
    at generateKeyPair (internal/crypto/keygen.js:33:16)
    at Promise (internal/util.js:274:30)
    at new Promise (<anonymous>)
    at generateKeyPair (internal/util.js:273:12)

To Reproduce

Code to reproduce:

const fs = require('fs')
const path = require('path')
const jose = require('jose')

const keystore = new jose.JWKS.KeyStore()

Promise.all([
  // ...
  keystore.generate('OKP', 'Ed25519', { use: 'sig' })
]).then(() => {
  fs.writeFileSync(path.resolve(__dirname, './keystore.json'), JSON.stringify(keystore.toJWKS(true), null, 2))
})
.then(() => console.log('Generate complete.'))
.catch(console.error)

Expected behaviour
No error

Environment:

  • jose version: latest
  • node version: latest

Additional context
Add any other context about the problem here.

  • the bug is happening on latest jose too.
  • i have searched the issues tracker on github for similar issues and couldn't find anything related.
@kareha kareha added the bug Something isn't working label Oct 4, 2019
@panva
Copy link
Owner

panva commented Oct 4, 2019

OKP is not supported under node 10 which you're clearly running (as opposed to 'latest' you wrote). I'll make sure the error is a bit nicer.

@panva panva closed this as completed in 0a16efb Oct 4, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants