rsakey: Resolve HS256 kid mismatch
Closes
package rsakey
import (
- "github.com/pborman/uuid"
+ "crypto/sha256"
+ "fmt"
)
type LocalHS256Manager struct {
@@ -30,9 +31,12 @@ type LocalHS256Manager struct {
}
func NewLocalHS256Manager(key []byte) *LocalHS256Manager {
+ h := sha256.New()
+ h.Write(key)
+
return &LocalHS256Manager{
key: key,
- kid: uuid.New(),
+ kid: fmt.Sprintf("%x", h.Sum(nil)),
}
}
