crypto

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCipherTextBlockSize = errors.New("ciphertext block size is too short")
View Source
var ErrUnsupportedAlgorithm = errors.New("unsupported signing algorithm")

Functions

func BytesToPrivateKey

func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error)

func DecryptAES

func DecryptAES(data string, key string) (string, error)

func DecryptBytesAES

func DecryptBytesAES(cipherText []byte, key string) ([]byte, error)

func EncryptAES

func EncryptAES(data string, key string) (string, error)

func EncryptBytesAES

func EncryptBytesAES(plainText []byte, key string) ([]byte, error)

func GetHashAlgorithm

func GetHashAlgorithm(sigAlgorithm jose.SignatureAlgorithm) (hash.Hash, error)

func HashString

func HashString(hash hash.Hash, s string, firstHalf bool) string

func Sign

func Sign(object interface{}, signer jose.Signer) (string, error)

func SignPayload

func SignPayload(payload []byte, signer jose.Signer) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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