chainscript

package
v0.0.0-...-6d02989 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingRecipients is the error returned when no recipients public keys were provided.
	ErrMissingRecipients = errors.New("no recipients were provided")
)

Functions

func EncryptLink(ctx context.Context, link *chainscript.Link, recipientsKeys []*PublicKeyInfo) error

EncryptLink encrypts the link's data with the provided public keys. The link is modified in place.

func NewLink(
	ctx context.Context,
	recipients []*PublicKeyInfo,
	wfID string,
	formData interface{},
	metadata interface{},
	action string,
	processState string,
	tags []string,
	prevSegment *chainscript.Segment,
	refs ...*chainscript.LinkReference) (*chainscript.Link, error)

NewLink returns a new chainscript link ready to be sent by the trace client. Note that it encrypts the form data, but does not sign the link since this is done in the client.

Types

type LinkRecipient

type LinkRecipient struct {
	PubKeyID     string `json:"pubKeyId"`
	PubKey       string `json:"pubKey"`
	SymmetricKey []byte `json:"symmetricKey"`
}

LinkRecipient is the type a recipient should have in the link's metadata.

type PublicKeyInfo

type PublicKeyInfo struct {
	ID        string
	PublicKey []byte
}

PublicKeyInfo contains the public key and its ID.

Jump to

Keyboard shortcuts

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