cookie

package
v0.0.0-...-6f70bfd Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(rand io.Reader) (*Authenticator, error)

NewAuthenticator creates a new Authenticator.

func (*Authenticator) MustSign

func (a *Authenticator) MustSign(dst, additionalData []byte) []byte

func (*Authenticator) Sign

func (a *Authenticator) Sign(dst, additionalData []byte) ([]byte, error)

Sign generates a cookie for additionalData, to be verified with Verify. Sign fails iff Read from rand fails.

func (*Authenticator) Verify

func (a *Authenticator) Verify(cookie, additionalData []byte) bool

Verify probabilistically tests if the cookie was generated by this authenticator for given additionalData.

Jump to

Keyboard shortcuts

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