packetproto

package
v0.0.0-...-30b4a77 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package packetproto implements a client of an issuer.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoToken signals a problem with token creation
	ErrNoToken = errors.New("client: token creation failed")
	// ErrMissingSigner signals that a request must be signed but no signer is present
	ErrMissingSigner = errors.New("client: signer missing but required")
	// ErrParamMismatch signals that a token and parameters do not match
	ErrParamMismatch = errors.New("client: parameters do not match token")
)
View Source
var Curve = elliptic.P256

Curve is the elliptic curve used by the generator for blind signature keys. Do NOT mix algorithms.

View Source
var HashFunc = eccutil.Sha1Hash

HashFunc of the generator. Don't mix algos!

View Source
var Rand = rand.Reader

Rand is the random source to use. System rand is the default

Functions

This section is empty.

Types

type Client

type Client struct {
	Keypool   *keypool.KeyPool             // The keypool
	PublicKey *[ed25519.PublicKeySize]byte // Public key of signer
	Curve     *eccutil.Curve
}

Client implements a token Client

func New

func New(keyBackends []types.Backend) (*Client, error)

New returns a new protocol client

func (Client) AddVerifyKey

func (c Client) AddVerifyKey(publicKey *[ed25519.PublicKeySize]byte)

AddVerifyKey adds a verification key from service-guards

func (Client) NewToken

NewToken returns a blinded token ready for signing. Blindmessage goes to server, blindfactors and clear message remain local

func (Client) Reissue

func (c Client) Reissue(oldTokenEnc []byte, oldOwner *[ed25519.PrivateKeySize]byte, newOwner *[ed25519.PublicKeySize]byte, params []byte) (toServer []byte, storeLocal *types.ReissuePacketPrivate, err error)

Reissue creates a request to be sent to the server to reissue a new token for an old token. oldOwner is the Private key for whoever owned oldToken. NewOwner is the public key for whoever is to own the new token. Both can be nil.

func (Client) Spend

func (c Client) Spend(token []byte, owner *[ed25519.PrivateKeySize]byte) ([]byte, error)

Spend creates a spend packet

func (Client) Unblind

func (c Client) Unblind(storeLocal *types.ReissuePacketPrivate, signature []byte) ([]byte, error)

Unblind a signature and convert it into a token

Jump to

Keyboard shortcuts

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