Documentation ¶
Index ¶
- Constants
- func VerifyToken(tokenstring string, key []byte) (bool, error)
- type FVT
- func (t *FVT) GetHeader() *TokenHeader
- func (t *FVT) GetPayLoad() TPayLoadInterface
- func (t *FVT) LoadHeader(header *TokenHeader)
- func (t *FVT) LoadPayLoad(b64 string) error
- func (t *FVT) SetPayLoad(p TPayLoadInterface) error
- func (t *FVT) String(k []byte) (token string, err error)
- func (t *FVT) Verify(tokenString string, key []byte) (check bool, err error)
- type FVTPayLoad
- type JWT
- func (t *JWT) GetHeader() *TokenHeader
- func (t *JWT) GetPayLoad() TPayLoadInterface
- func (t *JWT) LoadHeader(header *TokenHeader)
- func (t *JWT) LoadPayLoad(b64 string) error
- func (t *JWT) SetPayLoad(p TPayLoadInterface) error
- func (t *JWT) String(k []byte) (token string, err error)
- func (t *JWT) Verify(tokenString string, key []byte) (check bool, err error)
- type JWTPayLoad
- type THeaderInterface
- type TPayLoadInterface
- type Token
- type TokenHeader
Constants ¶
View Source
const ( TOKEN_JWT = "JWT" TOKEN_FVT = "FVT" ALGORITHM_HS256 = "HS256" ALGORITHM_HS384 = "HS384" ALGORITHM_HS512 = "HS512" )
View Source
const TOKENLIVETIME = 960
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FVT ¶
type FVT struct { Token Header *TokenHeader Payload TPayLoadInterface }
func (*FVT) GetHeader ¶
func (t *FVT) GetHeader() *TokenHeader
func (*FVT) GetPayLoad ¶
func (t *FVT) GetPayLoad() TPayLoadInterface
func (*FVT) LoadHeader ¶
func (t *FVT) LoadHeader(header *TokenHeader)
func (*FVT) LoadPayLoad ¶
func (*FVT) SetPayLoad ¶
func (t *FVT) SetPayLoad(p TPayLoadInterface) error
type FVTPayLoad ¶
type FVTPayLoad struct { ClientId string `json:"rqi"` State string `json:"stt"` ExpirationTime int `json:"exp"` NotBefore int `json:"nbf"` IssuedAt int `json:"iat"` CSRFToken string `json:"cft"` TPayLoadInterface }
func NewFvtTokenData ¶
func NewFvtTokenData(req string, state string, CSRFToken string, issuedAt int) *FVTPayLoad
type JWT ¶
type JWT struct { Token Header *TokenHeader Payload TPayLoadInterface // contains filtered or unexported fields }
func (*JWT) GetHeader ¶
func (t *JWT) GetHeader() *TokenHeader
func (*JWT) GetPayLoad ¶
func (t *JWT) GetPayLoad() TPayLoadInterface
func (*JWT) LoadHeader ¶
func (t *JWT) LoadHeader(header *TokenHeader)
func (*JWT) LoadPayLoad ¶
func (*JWT) SetPayLoad ¶
func (t *JWT) SetPayLoad(p TPayLoadInterface) error
type JWTPayLoad ¶
type THeaderInterface ¶
type TPayLoadInterface ¶
type Token ¶
type Token interface { GetHeader() *TokenHeader GetPayLoad() TPayLoadInterface String(key []byte) (string, error) Verify(token string, key []byte) (bool, error) SetPayLoad(p TPayLoadInterface) error LoadPayLoad(b64 string) error LoadHeader(header *TokenHeader) }
type TokenHeader ¶
type TokenHeader struct { Algorithm string `json:"alg"` TokenType string `json:"typ"` THeaderInterface }
func (*TokenHeader) GetAlgorithm ¶
func (h *TokenHeader) GetAlgorithm() hash.Hash
Click to show internal directories.
Click to hide internal directories.