sign

package
v0.3.0-docs.0...-f96dd80 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sign implements funcionality to create signers, which are able to sign messages and verify signed messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ed25519Signer

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

func (*Ed25519Signer) Sign

func (s *Ed25519Signer) Sign(message []byte) ([]byte, error)

func (*Ed25519Signer) Verify

func (s *Ed25519Signer) Verify(message, sig []byte) (bool, error)

type Signer

type Signer interface {
	Sign(message []byte) ([]byte, error)
	Verify(message, sig []byte) (bool, error)
}

Signer is the interface implemented by any value that has Sign and Verify methods. Signers are able to sign messages and verify them using a signature.

func NewEd25519Signer

func NewEd25519Signer() Signer

NewEd25519Signer creates an ed25519 signer from scratch.

func NewEd25519SignerFromFile

func NewEd25519SignerFromFile(privateKeyPath string) (Signer, error)

NewEd25519SignerFromFile creates an ed25519 signer using existing private and public keys. It also checks that keys are usable.

Jump to

Keyboard shortcuts

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