util

package
v0.0.0-...-94bde8a Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const COST int = 7

COST cost of the hash with bycrypt algorithm

Variables

This section is empty.

Functions

func Compare

func Compare(hash []byte, password []byte) bool

Compare verify a string (password) against a hash

func CreateEncryptedJWT

func CreateEncryptedJWT(payload string) (*jose.JSONWebEncryption, *rsa.PrivateKey, error)

CreateEncryptedJWT generates an encrypted JWT

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes generates an specified number of random bytes

func Hash

func Hash(password []byte) []byte

Hash has the specified value

func VerifyEncryptedToken

func VerifyEncryptedToken(payload string) (*jose.JSONWebEncryption, *rsa.PrivateKey, error)

VerifyEncryptedToken veries an encrypted JWT

Types

type Crypto

type Crypto struct{}

Crypto collections of security & cryptography functions

Jump to

Keyboard shortcuts

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