ecc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKey

func CreateKey() (string, string)

CreateKey generate private key/public key pair

func ECCDecrypt

func ECCDecrypt(ct []byte, privateKey string) ([]byte, error)

ECCDecrypt decrypt data by private key

func ECCEncrypt

func ECCEncrypt(pt []byte, publicKey string) ([]byte, error)

ECCEncrypt encrypt data by public key

func ECCSign

func ECCSign(plainText []byte, priPath string) ([]byte, []byte, error)

Ecc 签名 plainText 明文 priPath 私钥路径 返回 签名结果

func ECCVerify

func ECCVerify(plainText, rText, sText []byte, pubPath string) (bool, error)

ECC 签名验证 plainText 明文 rText,sText 签名 pubPath公钥文件路径 返回 验签结果 错误

func EccDecrypt

func EccDecrypt(cipherText []byte, filePath string) (plainText []byte, err error)

ECC 解密 cipherText 密文 filePath 私钥文件路径 返回 明文 错误

func EccEncrypt

func EccEncrypt(plainText []byte, filePath string) ([]byte, error)

Ecc 加密 plainText 明文 filePath 公钥文件路径 返回 密文 错误

func Ecrecover

func Ecrecover(data []byte, signature string) (string, error)

recover public key from data and signature

func GenerateECCKey

func GenerateECCKey(keySize int, dirPath string) error

生成ECC私钥对 keySize 密钥大小, 224 256 384 521 dirPath 密钥文件生成后保存的目录 返回 错误

func GetPublicKeyByPrivateKey

func GetPublicKeyByPrivateKey(privateKey string) (string, error)

func Sign

func Sign(privateKey string, data []byte) (string, error)

Sign create signature for data by private key

func Verify

func Verify(publicKey string, data []byte, signature string) bool

Verify verify signature for data by public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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