Documentation ¶
Overview ¶
Package token implements token type and handling functions.
Index ¶
- Constants
- Variables
- type Token
- func (t *Token) AddSignature(signature *jjm.ClearSignature)
- func (t *Token) GetSignature() *jjm.ClearSignature
- func (t Token) HasOwner() bool
- func (t Token) Hash() []byte
- func (t Token) Marshal() ([]byte, error)
- func (t Token) Properties() (keyid *[signkeys.KeyIDSize]byte, owner *[ed25519.PublicKeySize]byte)
Constants ¶
View Source
const ( // KeyIDSize is the length of the KeyID KeyIDSize = 32 // NonceSize is the size of the nonce NonceSize = 16 // OwnerSize is the length of the Owner key OwnerSize = ed25519.PublicKeySize )
Variables ¶
View Source
var Rand = rand.Reader
Rand is the random number source.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct { KeyID []byte // The ID of the KeyID, 32 byte Flag bool // Flag. 0x01 == verify signature Nonce []byte // Random nonce Owner []byte // Key for owner verification PointRX []byte // PointR, X coordinate PointRY []byte // PointR, Y coordinate ScalarS []byte // S Scalar ScalarR []byte // R Scalar }
Token without signature.
func (*Token) AddSignature ¶
func (t *Token) AddSignature(signature *jjm.ClearSignature)
AddSignature adds the signature to the token.
func (*Token) GetSignature ¶
func (t *Token) GetSignature() *jjm.ClearSignature
GetSignature returns the signature that is part of the token.
func (Token) Properties ¶
Properties returns the owner and keyID of a token.
Click to show internal directories.
Click to hide internal directories.