Documentation ¶
Overview ¶
Package packetproto implements a client of an issuer.
Index ¶
- Variables
- type Client
- func (c Client) AddVerifyKey(publicKey *[ed25519.PublicKeySize]byte)
- func (c Client) NewToken(issuerPubKey *signkeys.PublicKey, pubParams *jjm.BlindingParamClient, ...) (genericblinding.BlindingFactors, genericblinding.BlindMessage, *token.Token, ...)
- func (c Client) Reissue(oldTokenEnc []byte, oldOwner *[ed25519.PrivateKeySize]byte, ...) (toServer []byte, storeLocal *types.ReissuePacketPrivate, err error)
- func (c Client) Spend(token []byte, owner *[ed25519.PrivateKeySize]byte) ([]byte, error)
- func (c Client) Unblind(storeLocal *types.ReissuePacketPrivate, signature []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
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") )
var Curve = elliptic.P256
Curve is the elliptic curve used by the generator for blind signature keys. Do NOT mix algorithms.
var HashFunc = eccutil.Sha1Hash
HashFunc of the generator. Don't mix algos!
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 (Client) AddVerifyKey ¶
func (c Client) AddVerifyKey(publicKey *[ed25519.PublicKeySize]byte)
AddVerifyKey adds a verification key from service-guards
func (Client) NewToken ¶
func (c Client) NewToken(issuerPubKey *signkeys.PublicKey, pubParams *jjm.BlindingParamClient, owner *[ed25519.PublicKeySize]byte) (genericblinding.BlindingFactors, genericblinding.BlindMessage, *token.Token, error)
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.