hmac

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hmac provides HMAC signing methods for JWT.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVerifyFailed is returned when signature verification fails.
	ErrVerifyFailed = errors.New("jwt/hmac: verification failed")

	// ErrUnsupportedKeyType is returned when the secret is not a supported type.
	ErrUnsupportedKeyType = errors.New("jwt/hmac: unsupported key type")
)

Functions

func SignHS256

func SignHS256(token string, secret interface{}) (string, error)

SignHS256 signs a token with the provided secret using HMAC SHA-256.

func SignHS384

func SignHS384(token string, secret interface{}) (string, error)

SignHS384 signs a token with the provided secret using HMAC SHA-384.

func SignHS512

func SignHS512(token string, secret interface{}) (string, error)

SignHS512 signs a token with the provided secret using HMAC SHA-512.

func VerifyHS256

func VerifyHS256(token, signature string, secret interface{}) error

VerifyHS256 verifies the given signature using the given secret.

func VerifyHS384

func VerifyHS384(token, signature string, secret interface{}) error

VerifyHS384 verifies the given signature using the given secret.

func VerifyHS512

func VerifyHS512(token, signature string, secret interface{}) error

VerifyHS512 verifies the given signature using the given secret.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL