-
Hi, I'm having some issues getting the library to work with my ED25519 key, when I try to create a jwt token I get this error:
this is what my config looks like:
in case you're wondering how I made my jwt key, here's how:
hopefully someone can tell me where I went wrong. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@eman1986 differently from the other algorithms, EdDSA doesn't use the PEM format as input. Libsodium simplifies things quite a lot and provides functions to generate keys. You first need to generate the keypair and then extract the secret/public keys from it: $keypair = sodium_crypto_sign_keypair();
$secret = sodium_crypto_sign_secretkey($keypair);
$public = sodium_crypto_sign_publickey($keypair); Here's a full signature/verification process: https://3v4l.org/SKdcp |
Beta Was this translation helpful? Give feedback.
@eman1986 differently from the other algorithms, EdDSA doesn't use the PEM format as input.
Libsodium simplifies things quite a lot and provides functions to generate keys.
You first need to generate the keypair and then extract the secret/public keys from it:
Here's a full signature/verification process: https://3v4l.org/SKdcp