ecdsa

package
v0.0.0-...-fc9fbc1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 11 Imported by: 0

README

非对称加密算法之 ecdsa 椭圆曲线签名算法

"crypto/ecdsa" "crypto/elliptic" 官方实现两个包用于数字签名: 即私钥加密,公钥验签

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CryptSignByEcc

func CryptSignByEcc(input, priKeyFile, randSign string) (output string, err error)

使用ECC算法加密签名,返回签名数据 @param input 加密数据 @param priKeyFile 私钥文件 @param randSign 随机字符串

func GenerateKey

func GenerateKey(randKey, pemKeyPath string) error

生成ECC算法的公钥和私钥文件 根据随机字符串生成,randKey至少36位

func GetRandomString

func GetRandomString(length int) string

生成指定math/rand字节长度的随机字符串

func UnSignCryptEcc

func UnSignCryptEcc(cryptBytes []byte) (rint, sint big.Int, err error)

使用ECC算法解密,返回加密前的椭圆曲线大整数

func VerifyCryptEcc

func VerifyCryptEcc(srcStr, cryptStr, pubKeyFile string) (bool, error)

使用ECC算法,对密文和明文进行匹配校验 @param srcStr 明文 @param cryptStr 密文 @param publicFile 公钥文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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