Skip to content

Is there any ways we can generate public key from private key using this library? #341

Answered by panva
yangj56 asked this question in Q&A
Discussion options

You must be logged in to vote

how can i generate a public key keylike using the private key in keylike format?

KeyLike is just an interface, it's either a KeyObject (in node runtime), or CryptoKey (in web-api runtimes like the browser). See KeyLike Furthermore you don't generate a public key when you have a private one, you just extract or derive it from it. You can extract the public key out of a private one in node using the KeyObject apis (see node crypto doc). You cannot do the same with CryptoKey, the WebCrypto API does not have affordances for that.

In additional question: is there any differences in jwt verify and jws verify?

Yes. JWT can take the form of a JWE or JWS and the JWT API also verifies and parse…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yangj56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants