signing

package
v1.2.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 7 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
	Vote       protocol.VoteType
	Timestamp  Timestamp

	// Ignore64Byte (when set) stops the signature builder from automatically
	// correcting a transaction header or body that marshals to 64 bytes.
	Ignore64Byte bool
}

func (*Builder) AddDelegator added in v0.6.0

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

func (*Builder) ClearTimestamp added in v1.0.0

func (s *Builder) ClearTimestamp() *Builder

func (*Builder) Copy added in v1.0.0

func (s *Builder) Copy() *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, dest *url.URL) (*protocol.PartitionSignature, 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, sigMdHash, message []byte) error

type Signer

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

type Timestamp added in v1.0.0

type Timestamp interface {
	Get() (uint64, error)
}

type TimestampFromValue added in v1.0.0

type TimestampFromValue uint64

func (TimestampFromValue) Get added in v1.0.0

func (t TimestampFromValue) Get() (uint64, error)

type TimestampFromVariable added in v1.0.0

type TimestampFromVariable uint64

func (*TimestampFromVariable) Get added in v1.0.0

func (t *TimestampFromVariable) Get() (uint64, error)

Jump to

Keyboard shortcuts

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