ecdsa

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignData

func SignData(privateKey *ecdsa.PrivateKey, data []byte) ([]byte, error)

SignData 使用ECDSA私钥为数据签名 参数:

  • privateKey: ECDSA私钥
  • data: 待签名的数据

返回值:

  • []byte: ASN.1格式的签名
  • error: 错误信息

func VerifySignature

func VerifySignature(publicKey *ecdsa.PublicKey, data []byte, signature []byte) (bool, error)

VerifySignature 使用ECDSA公钥验证数据的签名 参数:

  • publicKey: ECDSA公钥
  • data: 原始数据
  • signature: ASN.1格式的签名

返回值:

  • bool: 签名是否有效
  • error: 错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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