cipher

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToPrivateKey

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

func BytesToPublicKey

func BytesToPublicKey(pub []byte) (*rsa.PublicKey, error)

func CheckSig

func CheckSig(msg []byte, sig []byte, pub *rsa.PublicKey) error

func DecodeAesJson

func DecodeAesJson(cipherText string, priv string, dest interface{}) error

func DecryptAes

func DecryptAes(cipherText []byte, key []byte) ([]byte, error)

func DecryptWithPrivateKey

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

func EncryptAes

func EncryptAes(plainText []byte, key []byte) ([]byte, error)

func EncryptAesJson

func EncryptAesJson(data interface{}, priv string) (string, error)

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

func GenerateKeyPair

func GenerateKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

func GenerateKeyPairBase64

func GenerateKeyPairBase64(bits int) (string, string, error)

func PrivateKeyToBytes

func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte

func PublicKeyToBytes

func PublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)

func SignMessage

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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