diff --git a/signing_method.go b/signing_method.go index 109dd0f..12cf0f3 100644 --- a/signing_method.go +++ b/signing_method.go @@ -2,11 +2,11 @@ package jwt var signingMethods = map[string]func() SigningMethod{} -// Signing method +// Implement SigningMethod to add new methods for signing or verifying tokens. type SigningMethod interface { - Verify(signingString, signature string, key interface{}) error - Sign(signingString string, key interface{}) (string, error) - Alg() string + Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid + Sign(signingString string, key interface{}) (string, error) // Returns encoded signature or error + Alg() string // returns the alg identifier for this method (example: 'HS256') } // Register the "alg" name and a factory function for signing method.