signing

package
v0.8.1-beta Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.6.0

type Builder struct {
	InitMode   InitHashMode
	Type       protocol.SignatureType
	Url        *url.URL
	Delegators []*url.URL
	Signer     Signer
	Version    uint64
	Timestamp  uint64
}

func (*Builder) AddDelegator added in v0.6.0

func (s *Builder) AddDelegator(delegator *url.URL) *Builder

func (*Builder) Import added in v1.0.0

func (s *Builder) Import(sig protocol.Signature) (*Builder, error)

func (*Builder) Initiate added in v0.6.0

func (s *Builder) Initiate(txn *protocol.Transaction) (protocol.Signature, error)

func (*Builder) InitiateSynthetic added in v0.6.0

func (s *Builder) InitiateSynthetic(txn *protocol.Transaction, router routing.Router, ledger *protocol.SyntheticLedger) (*protocol.SyntheticSignature, error)

func (*Builder) SetKeyPageUrl added in v0.6.0

func (s *Builder) SetKeyPageUrl(bookUrl *url.URL, pageIndex uint64) *Builder

func (*Builder) SetPrivateKey added in v0.6.0

func (s *Builder) SetPrivateKey(privKey []byte) *Builder

func (*Builder) SetSigner added in v0.6.0

func (s *Builder) SetSigner(signer Signer) *Builder

func (*Builder) SetTimestamp added in v0.6.0

func (s *Builder) SetTimestamp(timestamp uint64) *Builder

func (*Builder) SetTimestampToNow added in v0.6.0

func (s *Builder) SetTimestampToNow() *Builder

func (*Builder) SetTimestampWithVar added in v0.6.0

func (s *Builder) SetTimestampWithVar(timestamp *uint64) *Builder

func (*Builder) SetType added in v0.6.0

func (s *Builder) SetType(typ protocol.SignatureType) *Builder

func (*Builder) SetUrl added in v0.6.0

func (s *Builder) SetUrl(u *url.URL) *Builder

func (*Builder) SetVersion added in v0.6.0

func (s *Builder) SetVersion(version uint64) *Builder

func (*Builder) Sign added in v0.6.0

func (s *Builder) Sign(message []byte) (protocol.Signature, error)

func (*Builder) UseFaucet added in v0.6.0

func (s *Builder) UseFaucet() *Builder

func (*Builder) UseMerkleHash added in v0.6.0

func (s *Builder) UseMerkleHash() *Builder

func (*Builder) UseSimpleHash added in v0.6.0

func (s *Builder) UseSimpleHash() *Builder

type InitHashMode added in v0.6.0

type InitHashMode int
const (
	InitWithMerkleHash InitHashMode = iota
	InitWithSimpleHash
)

type PrivateKey added in v0.6.0

type PrivateKey []byte

func (PrivateKey) SetPublicKey added in v0.6.0

func (k PrivateKey) SetPublicKey(sig protocol.Signature) error

func (PrivateKey) Sign added in v0.6.0

func (k PrivateKey) Sign(sig protocol.Signature, message []byte) error

type Signer

type Signer interface {
	SetPublicKey(protocol.Signature) error
	Sign(protocol.Signature, []byte) error
}

Jump to

Keyboard shortcuts

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