Skip to content

Commit 5994abc

Browse files
authored
fix Ed25519 parameter value to EdDSA (#4)
1 parent 3b0c70d commit 5994abc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/usage/signing_methods.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Each signing method expects a different object type for its signing keys. The fo
2727
| [RSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodRSA)[^rsa] | `RS256`,`RS384`,`RS512` | [`*rsa.PrivateKey`](https://pkg.go.dev/crypto/rsa#PrivateKey) | [`*rsa.PublicKey`](https://pkg.go.dev/crypto/rsa#PublicKey) |
2828
| [ECDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodECDSA)[^ecdsa] | `ES256`,`ES384`,`ES512` | [`*ecdsa.PrivateKey`](https://pkg.go.dev/crypto/ecdsa#PrivateKey) | [`*ecdsa.PublicKey`](https://pkg.go.dev/crypto/ecdsa#PublicKey) |
2929
| [RSA-PSS signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodRSAPSS)[^rsapss] | `PS256`,`PS384`,`PS512` | [`*rsa.PrivateKey`](https://pkg.go.dev/crypto/rsa#PrivateKey) | [`*rsa.PublicKey`](https://pkg.go.dev/crypto/rsa#PublicKey) |
30-
| [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodEd25519)[^eddsa] | `Ed25519` | [`ed25519.PrivateKey`](https://pkg.go.dev/crypto/ed25519#PrivateKey) | [`ed25519.PublicKey`](https://pkg.go.dev/crypto/ed25519#PublicKey) |
30+
| [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v5#SigningMethodEd25519)[^eddsa] | `EdDSA` | [`ed25519.PrivateKey`](https://pkg.go.dev/crypto/ed25519#PrivateKey) | [`ed25519.PublicKey`](https://pkg.go.dev/crypto/ed25519#PublicKey) |
3131

3232
[^jwe]: [RFC 7516](https://datatracker.ietf.org/doc/html/rfc7516)
3333
[^hmac]: [Section 3.2 of RFC 7518](https://datatracker.ietf.org/doc/html/rfc7518#section-3.2)
@@ -44,4 +44,4 @@ We often get asked why the HMAC signing method only supports `[]byte` and not `s
4444

4545
Second, using `string` as a key type to represent a symmetric key can lead to unwanted situations. It gives the impression that this is something 'human readable' (like a password), but it is not. A symmetric key should contain as much entropy as possible and therefore include characters from the whole character set (even 'unreadable' ones) and ideally be generated by a cryptographic random source, such as [`rand.Read`](https://pkg.go.dev/crypto/rand#Read). Signing tokens with a cryptographically weak key will compromise the security of the tokens and in effect everything that depends on it, e.g., user authentication.
4646

47-
If you have trouble handling a `[]byte` key in our setup, e.g., because you are reading it from your environment variables on your cluster or similar, you can always use base64 encoding to have the key as a "string" type outside of your program and then use [`base64.Encoding.DecodeString`](https://pkg.go.dev/encoding/base64#Encoding.DecodeString) to decode the base64 string into the `[]byte` slice that the signing method needs.
47+
If you have trouble handling a `[]byte` key in our setup, e.g., because you are reading it from your environment variables on your cluster or similar, you can always use base64 encoding to have the key as a "string" type outside of your program and then use [`base64.Encoding.DecodeString`](https://pkg.go.dev/encoding/base64#Encoding.DecodeString) to decode the base64 string into the `[]byte` slice that the signing method needs.

0 commit comments

Comments
 (0)