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.
Click to show internal directories.
Click to hide internal directories.