GoCryptoConditions

package module
v0.0.0-...-f6a0e8a Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2018 License: MIT Imports: 9 Imported by: 0

README

Crypto-Conditions in Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64UrlEncode

func Base64UrlEncode(p []byte) string

Types

type ConditionType

type ConditionType int
const (
	CTThresholdSha256 ConditionType = 2
	CTEd25519Sha256   ConditionType = 4
)

func (ConditionType) IsCompound

func (t ConditionType) IsCompound() bool

func (ConditionType) String

func (t ConditionType) String() string

type Conditions

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

func NewSimpleCondition

func NewSimpleCondition(conditionType ConditionType, fingerprint []byte, cost int) *Conditions

func (Conditions) Cost

func (c Conditions) Cost() int

func (*Conditions) DecodeCondition

func (c *Conditions) DecodeCondition(encodedCondition []byte) (*Conditions, error)

func (*Conditions) Encode

func (c *Conditions) Encode() ([]byte, error)

func (*Conditions) Equals

func (c *Conditions) Equals(other *Conditions) bool

func (Conditions) Fingerprint

func (c Conditions) Fingerprint() []byte

func (Conditions) Type

func (c Conditions) Type() ConditionType

func (*Conditions) URI

func (c *Conditions) URI() string

type Ed25519Sha256

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

func NewEd25519Sha256

func NewEd25519Sha256(pubkey []byte, signature []byte) (*Ed25519Sha256, error)

func (Ed25519Sha256) Condition

func (f Ed25519Sha256) Condition() *Conditions

func (Ed25519Sha256) ConditionType

func (f Ed25519Sha256) ConditionType() ConditionType

func (Ed25519Sha256) Cost

func (f Ed25519Sha256) Cost() int

func (Ed25519Sha256) DecodeFulfillment

func (f Ed25519Sha256) DecodeFulfillment(encodedFulfillment []byte) error

func (Ed25519Sha256) Ed25519PublicKey

func (f Ed25519Sha256) Ed25519PublicKey() ed25519.PublicKey

func (Ed25519Sha256) Encode

func (f Ed25519Sha256) Encode() ([]byte, error)

func (Ed25519Sha256) Validate

func (f Ed25519Sha256) Validate(condition *Conditions, message []byte) error

Jump to

Keyboard shortcuts

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