sign

package
Version: v0.0.0-...-a98aea1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2017 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}, keys ...Signer) (*data.Signed, error)

func Sign

func Sign(s *data.Signed, k Signer) error

Types

type PrivateKey

type PrivateKey struct {
	Type  string          `json:"keytype"`
	Value PrivateKeyValue `json:"keyval"`
}

func GenerateEd25519Key

func GenerateEd25519Key() (*PrivateKey, error)

func (*PrivateKey) PublicData

func (k *PrivateKey) PublicData() *data.Key

func (*PrivateKey) Signer

func (k *PrivateKey) Signer() Signer

type PrivateKeyValue

type PrivateKeyValue struct {
	Public  data.HexBytes `json:"public"`
	Private data.HexBytes `json:"private"`
}

type Signer

type Signer interface {
	// ID returns the TUF key id
	ID() string

	// Type returns the TUF key type
	Type() string

	// Signer is used to sign messages and provides access to the public key.
	// The signer is expected to do its own hashing, so the full message will be
	// provided as the message to Sign with a zero opts.HashFunc().
	crypto.Signer
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL