Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSignature = errors.New("invalid signature") ErrShortToken = errors.New("token is too small to be valid") )
Functions ¶
Types ¶
type Protect ¶
Protect is the main struct used to sign and unsigned data
func New ¶
New takes a secret key and returns a new Protect struct. If no Options are provided then minimal defaults will be used. NOTE: The key must be 64 bytes or fewer . If a larger key is provided it will be truncated to 64 bytes.
type Signer ¶
type Signer struct {
Secret []byte
}
func (*Signer) GenerateToken ¶
func (*Signer) VerifyToken ¶
Click to show internal directories.
Click to hide internal directories.