Documentation ¶
Index ¶
- Variables
- type Token
- func (t *Token) EncodeHex() string
- func (t *Token) EncodeJSON() []byte
- func (t *Token) HexID() string
- func (t *Token) HexSecret() string
- func (t *Token) Reference() *core.Reference
- func (t *Token) SignDetached(key interface{}) ([]byte, error)
- func (t *Token) ToBootstrapToken() *core.BootstrapToken
- func (t *Token) VerifyDetached(sig []byte, key interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMalformedToken = errors.New("malformed token")
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { ID []byte `json:"id"` // bytes 0-5 Secret []byte `json:"secret,omitempty"` // bytes 6-31 }
func FromBootstrapToken ¶
func FromBootstrapToken(t *core.BootstrapToken) (*Token, error)
func NewToken ¶
Creates a new token by reading bytes from the given random source. the default source is crypto/rand.Reader.
func (*Token) EncodeJSON ¶
func (*Token) SignDetached ¶
Signs the token and returns a JWS with the payload detached
func (*Token) ToBootstrapToken ¶
func (t *Token) ToBootstrapToken() *core.BootstrapToken
Click to show internal directories.
Click to hide internal directories.