encrip

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptCBC

func DecryptCBC(src, sKey, ivParameter string) string

DecryptCBC : encrip AES/CBC/PKCS5Padding

func DesencripAES

func DesencripAES(key string, text string) (string, error)

DesencripAES : Desencripta en aes 256 un texto donde la key es la llave noce una llave secundaria y el texto a ecriptar

func EncripAES

func EncripAES(key string, text string) (string, error)

EncripAES : Encripta en aes 256 un texto donde la key es la llave noce una llave secundaria y el texto a ecriptar

func EncryptCBC

func EncryptCBC(src, sKey, ivParameter string) string

Encriptacion AES AES/CBC/PKCS5Padding

EncryptCBC : encrip AES/CBC/PKCS5Padding

func GenToken

func GenToken(str string) string

GenToken : Genera un token dependiendo de un string.

func GeneredHashMd5

func GeneredHashMd5(key string) string

GeneredHashMd5 : Genera un hash con encriptacion md5

func GeneredHashSha256

func GeneredHashSha256(key string) string

GeneredHashSha256 : Genera un hash con encriptacion sha256

func GeneredUUID

func GeneredUUID() string

GeneredUUID : Genera un codigo uuid unico

func TokenifyJwt added in v1.0.2

func TokenifyJwt(inputData TokenInput) (string, error)

TokenifyJwt : crea un token con data jwt

Types

type TokenInput added in v1.0.2

type TokenInput struct {
	//Autor o empresa
	Signature string
	//timepo a expirar si es menor o igual a 0 no expirara
	Expired        int
	SecretKey      string
	UserData       map[string]interface{}
	AdditionalData map[string]interface{}
}

TokenData : estructura para devolver un token

type TokenOutput added in v1.0.2

type TokenOutput struct {
	UserData       map[string]interface{} `json:"userData,omitempty"`
	AdditionalData map[string]interface{} `json:"additionalData,omitempty"`
	jwt.StandardClaims
}

func DetokenifyJwt added in v1.0.2

func DetokenifyJwt(tokenStr, secretKey string) (tp *TokenOutput, err error)

DetokenifyJwt : decodifica un token regresando la data correspondiente

Jump to

Keyboard shortcuts

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