token

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Live

type Live struct {
	// contains filtered or unexported fields
}

Represents a reverse-authentication token

func NewLive

func NewLive() *Live

Constructor which initializes a token for use by the associated host object

func (*Live) Clear

func (l *Live) Clear()

Clear is used to set token to a nil value as store will not let you do this explicitly

func (*Live) Get

func (l *Live) Get() (Token, bool)

Get reads and returns the token

func (*Live) GetBytes

func (l *Live) GetBytes() []byte

Get reads and returns the token

func (*Live) Has

func (l *Live) Has() bool

Returns true if a token is present

func (*Live) Set

func (l *Live) Set(newToken Token)

Set rewrites the token for negotiation or renegotiation

type Map

type Map struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap() *Map

func (*Map) Generate

func (m *Map) Generate() Token

func (*Map) Validate

func (m *Map) Validate(token Token) bool

type Token

type Token [nonce.NonceLen]byte

func GenerateToken

func GenerateToken(newNonce nonce.Nonce) Token

Generates a new token and adds it to internal state

func Unmarshal

func Unmarshal(newVal []byte) (Token, error)

func (Token) Equals

func (t Token) Equals(u Token) bool

func (Token) Marshal

func (t Token) Marshal() []byte

Jump to

Keyboard shortcuts

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