Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ed25519_utils.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package jwt

import (
"crypto"
"crypto/ed25519"
"crypto/x509"
"encoding/pem"
Expand All @@ -14,7 +13,7 @@ var (
)

// ParseEdPrivateKeyFromPEM parses a PEM-encoded Edwards curve private key
func ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) {
func ParseEdPrivateKeyFromPEM(key []byte) (ed25519.PrivateKey, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given these are public functions, and the underlying types are different, I think this would be a breaking change.

We avoid breaking changes in major versions.

I do agree having parity would be nice, but not at the expense of introducing an incompatible change.

var err error

// Parse PEM block
Expand All @@ -39,7 +38,7 @@ func ParseEdPrivateKeyFromPEM(key []byte) (crypto.PrivateKey, error) {
}

// ParseEdPublicKeyFromPEM parses a PEM-encoded Edwards curve public key
func ParseEdPublicKeyFromPEM(key []byte) (crypto.PublicKey, error) {
func ParseEdPublicKeyFromPEM(key []byte) (ed25519.PublicKey, error) {
var err error

// Parse PEM block
Expand Down