encrypt

package
v0.0.0-...-d12ec4b Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncrypterMaker

type EncrypterMaker func(string) TokenEncrypter

type Encryptor

type Encryptor interface {
	Encrypt(content []byte) string
}

type HmacEncryptor

type HmacEncryptor struct {
	Key []byte
}

func (*HmacEncryptor) Encrypt

func (encryptor *HmacEncryptor) Encrypt(content []byte) string

type JwtEncrypter

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

func (*JwtEncrypter) Add

func (encrypter *JwtEncrypter) Add(key string, value string) bool

func (*JwtEncrypter) FromStr

func (encrypter *JwtEncrypter) FromStr(token string) bool

func (*JwtEncrypter) Get

func (encrypter *JwtEncrypter) Get(key string) (string, bool)

func (*JwtEncrypter) ToStr

func (encrypter *JwtEncrypter) ToStr() (string, bool)

type TokenEncrypter

type TokenEncrypter interface {
	Add(string, string) bool
	FromStr(string) bool
	Get(string) (string, bool)
	ToStr() (string, bool)
}

TODO: name should be Encrypter?

func JwtEncrypterMaker

func JwtEncrypterMaker(secret string) TokenEncrypter

Jump to

Keyboard shortcuts

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