signhandler

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceSignHandler

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

NonceSignHandler is a component which signs and check authorization nonce.

func NewSignHandler

func NewSignHandler(key *ecdsa.PrivateKey) *NonceSignHandler

NewSignHandler creates a new sign handler.

func (*NonceSignHandler) AddUncheckedNode

func (handler *NonceSignHandler) AddUncheckedNode(hostID id.ID, nonce []byte, ref core.RecordRef)

AddUncheckedNode adds a new node to authorization.

func (*NonceSignHandler) GetPrivateKey

func (handler *NonceSignHandler) GetPrivateKey() *ecdsa.PrivateKey

GetPrivateKey returns a private key.

func (*NonceSignHandler) SignNonce

func (handler *NonceSignHandler) SignNonce(nonce []byte) ([]byte, error)

SignNonce sign a nonce.

func (*NonceSignHandler) SignedNonceIsCorrect

func (handler *NonceSignHandler) SignedNonceIsCorrect(coordinator core.NetworkCoordinator, hostID id.ID, signedNonce []byte) bool

SignedNonceIsCorrect checks a nonce sign.

type SignHandler

type SignHandler interface {
	AddUncheckedNode(hostID id.ID, nonce []byte, ref core.RecordRef)
	SignedNonceIsCorrect(coordinator core.NetworkCoordinator, hostID id.ID, signedNonce []byte) bool
	SignNonce(nonce []byte) ([]byte, error)
	GetPrivateKey() *ecdsa.PrivateKey
}

type UncheckedNode

type UncheckedNode struct {
	Ref   core.RecordRef
	Nonce []byte
}

UncheckedNodes is a map of not authorized nodes.

Jump to

Keyboard shortcuts

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