signing

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT, Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileToECDSA

func FileToECDSA(hexPath string) (*ecdsa.PrivateKey, error)

FileToECDSA parses a file path to a hex-encoded secp256k1 private key to an ECDSA private key.

func HexToECDSA

func HexToECDSA(hexKey string) (*ecdsa.PrivateKey, error)

HexToECDSA parses a hex-encoded secp256k1 private key string to an ECDSA private key.

Types

type Signer

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

Signer allows you to sign a big stream of bytes by calling Sum multiple times, then Sign.

func NewSigner

func NewSigner(pk *ecdsa.PrivateKey) *Signer

NewSigner creates a new signer.

func (*Signer) Sign

func (s *Signer) Sign() ([]byte, error)

Sign signs the internal state.

func (*Signer) SignBytes

func (s *Signer) SignBytes(data []byte) ([]byte, error)

SignBytes signs the provided bytes, returning the signature as a byte slice.

func (*Signer) SignFile

func (s *Signer) SignFile(filename string) ([]byte, error)

SignFile signs an entire file, returning the signature as a byte slice.

func (*Signer) Sum

func (s *Signer) Sum(chunk []byte)

Sum updates the hash state with a new chunk.

Jump to

Keyboard shortcuts

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