tools

package
v0.0.0-...-aa28e5a Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey(size int) (*rsa.PrivateKey, error)

func RandomIndexes

func RandomIndexes(n, k int) (result []int)

func SHA256

func SHA256(data interface{}) []byte

func SHA256Arr

func SHA256Arr(data interface{}) []int

func SHA256Int

func SHA256Int(data interface{}) int

func SHA256Str

func SHA256Str(data interface{}) string

func SignWithPrivateKey

func SignWithPrivateKey(data []byte, privateKey *rsa.PrivateKey) ([]byte, error)

func SignWithPrivateKeyStr

func SignWithPrivateKeyStr(data string, privateKey *rsa.PrivateKey) (string, error)

func VerifyWithPublicKey

func VerifyWithPublicKey(data []byte, signature []byte, publicKey *rsa.PublicKey) error

func VerifyWithPublicKeyStr

func VerifyWithPublicKeyStr(data string, signature string, publicKey *rsa.PublicKey) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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