signing

package
v0.0.0-...-bcff216 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(pubkey *PublicKey, message []byte, sign []byte) bool

Verify verifies the provided message

Types

type EdSigner

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

EdSigner represents an ED25519 signer

func NewEdSigner

func NewEdSigner() *EdSigner

NewEdSigner returns an auto-generated ed signer

func NewEdSignerFromBuffer

func NewEdSignerFromBuffer(buff []byte) (*EdSigner, error)

NewEdSignerFromBuffer builds a signer from a private key as byte buffer

func (*EdSigner) PublicKey

func (es *EdSigner) PublicKey() *PublicKey

PublicKey returns the public key of the signer

func (*EdSigner) Sign

func (es *EdSigner) Sign(m []byte) []byte

Sign signs the provided message

func (*EdSigner) ToBuffer

func (es *EdSigner) ToBuffer() []byte

ToBuffer returns the private key as a byte buffer

type PublicKey

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

PublicKey is the type describing a public key

func NewPublicKey

func NewPublicKey(pub []byte) *PublicKey

NewPublicKey constructs a new public key instance from a byte array

func (*PublicKey) Bytes

func (p *PublicKey) Bytes() []byte

Bytes returns the public key as byte array

func (*PublicKey) Equals

func (p *PublicKey) Equals(o *PublicKey) bool

Equals returns true iff the public keys are equal

func (*PublicKey) ShortString

func (p *PublicKey) ShortString() string

ShortString returns a representative sub string

func (*PublicKey) String

func (p *PublicKey) String() string

String returns the public key as an hex representation string

Jump to

Keyboard shortcuts

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