add token framing, crypto and errors
This commit is contained in:
parent
71483982ca
commit
a6aad1a1d6
5 changed files with 448 additions and 0 deletions
15
errors.go
Normal file
15
errors.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package ficha
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
// ErrInvalidToken means the token is malformed, has an unsupported
|
||||
// version, fails descryption, or has been tampered with.
|
||||
ErrInvalidToken = errors.New("ficha: invalid token")
|
||||
// ErrExpiredToken means the token's expiry time has passed.
|
||||
ErrExpiredToken = errors.New("ficha: token expired")
|
||||
// ErrRevokedToken means the token's ID is in the revocation store.
|
||||
ErrRevokedToken = errors.New("ficha: token revoked")
|
||||
// ErrUnknownKey means the token references a key ID not in the keyring.
|
||||
ErrUnknownKey = errors.New("ficha: unknown key id")
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue