signature

package
v0.0.0-...-31bde24 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EcdsaSign

func EcdsaSign(priv *ecdsa.PrivateKey, text []byte) (string, error)

EcdsaSign The encryption result of the text signature is returned. The result is the serialization and splicing of the digital certificate R and s, and then converted into string with hex

func EcdsaSignDecode

func EcdsaSignDecode(sign string) (rint, sint big.Int, err error)

EcdsaSignDecode r, s String parsing

func EcdsaSignEncode

func EcdsaSignEncode(r, s *big.Int) (string, error)

EcdsaSignEncode r, s Convert to string

func EcdsaVerify

func EcdsaVerify(text []byte, sign string, pubKey *ecdsa.PublicKey) (bool, error)

EcdsaVerify Verify whether the text content is consistent with the signature. Use the public key to verify the signature and text content

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer ...

func NewSigner

func NewSigner(priv crypto.PrivateKey) *Signer

NewSigner ...

func (*Signer) Sign

func (s *Signer) Sign(text []byte) (sign string, err error)

Sign

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

Verifier ...

func NewVerifier

func NewVerifier(pub crypto.PublicKey) *Verifier

NewVerifier ...

func (*Verifier) Verify

func (v *Verifier) Verify(text []byte, sign string) (bool, error)

Verify Verify signature

Jump to

Keyboard shortcuts

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