macaronsign

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: MIT Imports: 16 Imported by: 2

README

macaron sign

Go Reference

Library for signing and encrypting HTTP cookies Or you can use it when you want to create some authenticated string.

go get -u -v github.com/lemon-mint/macaronsign

Example of decrypting after encryption

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadSignature error = errors.New("bad signature")

ErrBadSignature : This error occurs when the signature values do not match.

View Source
var ErrExpired error = errors.New("expired token")

ErrExpired : Token has expired

Functions

This section is empty.

Types

type Signer

type Signer struct {
	EXP int64
	// contains filtered or unexported fields
}

Signer : Signature generator

func NewSigner

func NewSigner(Expiry int64, key []byte, EncVersion int, SignVersion int) Signer

NewSigner : make new signer object

func (Signer) DecryptAndVerify

func (s Signer) DecryptAndVerify(data string) ([]byte, error)

DecryptAndVerify : Decrypt data and verify Signature

func (Signer) SignAndEncrypt

func (s Signer) SignAndEncrypt(data []byte) string

SignAndEncrypt : Signs the input data and returns the encrypted result

Jump to

Keyboard shortcuts

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