Documentation ¶
Index ¶
- type Base
- type ChainType
- type ClientInfo
- type EncryptionParameters
- type Entropy
- type Generic
- type IgnoreIfUnsupported
- type InnerLink
- type KID
- type KeyPair
- type LinkID
- type LinkType
- type MerkleRoot
- type OuterLink
- type PTKType
- type ParseError
- type PerTeamKey
- type PerTeamKeyGeneration
- type RotateKey
- type RotateKeyBody
- type Seqno
- type Sig
- type Sig3Bundle
- type Sig3Error
- type Sig3ExportJSON
- type SigVersion
- type Signer
- type Tail
- type Team
- type TeamID
- type Time
- type UID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base struct for sig3 links that contains much of the raw material pulled down or off local storage. Most implementations of sig3 links should include this base class.
type ClientInfo ¶
type EncryptionParameters ¶
type EncryptionParameters struct { KID KID `codec:"k"` Nonce []byte `codec:"n"` Version int `codec:"v"` }
If the inner link is encrypted, we specify the encryption parameters with this offloaded structure. So far, we don't know of any such encrypted payloads, but we'll allow it.
type Generic ¶
type Generic interface { Signer() *Signer Prev() *LinkID Seqno() Seqno Outer() OuterLink Inner() *InnerLink // contains filtered or unexported methods }
Generic sig3 wrapper class, should implement the following interface.
type IgnoreIfUnsupported ¶
type IgnoreIfUnsupported bool
type InnerLink ¶
type InnerLink struct { Body interface{} `codec:"b"` // The actual body, which varies based on the type in the outer link Ctime Time `codec:"c"` // Seconds since 1970 UTC. Entropy Entropy `codec:"e"` // entropy for hiding the value of the inner link ClientInfo *ClientInfo `codec:"i"` // Optional client type making sig MerkleRoot *MerkleRoot `codec:"m"` // Optional snapshot of merkle root at time of sig ParentChain *Tail `codec:"p"` // Optional grab of the most-recent chain tail of the corresponding parent chain Signer Signer `codec:"s"` // Info on the signer, including UID, KID and eldest Team *Team `codec:"t"` // for teams, and null otherwise }
type MerkleRoot ¶
type OuterLink ¶
type OuterLink struct { Version SigVersion `codec:"version"` // should be 3 Seqno Seqno `codec:"seqno"` Prev *LinkID `codec:"prev"` InnerLinkID LinkID `codec:"curr"` // hash of the msgpack of the InnerLink LinkType LinkType `codec:"type"` // hash of the msgpack of the previous OuterLink ChainType ChainType `codec:"chaintype"` IgnoreIfUnsupported IgnoreIfUnsupported `codec:"ignore_if_unsupported"` // New field for V3; if this link is encrypted, specify the format, nonce and PUK EncryptionParameters *EncryptionParameters `codec:"encryption_parameters"` // contains filtered or unexported fields }
OuterLink V3 is the third version of Keybase sigchain signatures, it roughly approximates the outer link v2s that we have previously used.
type PTKType ¶
type PTKType int
const ( // The default, legacy type. All users, including the readers, can access it. PTKTypeReader PTKType = 0 )
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func (ParseError) Error ¶
func (e ParseError) Error() string
type PerTeamKey ¶
type PerTeamKeyGeneration ¶
type PerTeamKeyGeneration = keybase1.PerTeamKeyGeneration
type RotateKey ¶
type RotateKey struct {
Base
}
RotateKey is a sig3 link type for a PTK rotation. Handles multiple PTK types being rotated in one link.
func NewRotateKey ¶
func NewRotateKey(o OuterLink, i InnerLink, b RotateKeyBody) *RotateKey
NewRotateKey makes a new rotate key given sig3 skeletons (Outer and Inner) and also the PTKs that are going to be advertised in the sig3 link.
func (RotateKey) Sign ¶
func (r RotateKey) Sign(outer KeyPair, inners []KeyPair) (ret *Sig3Bundle, err error)
Sign the RotateKey structure, with the given user's keypair (outer), and with the new PTKs (inner). Return a Sig3Bundle, which was the exportable information, that you can export either to local storage or up to the server.
type RotateKeyBody ¶
type RotateKeyBody struct {
PTKs []PerTeamKey `codec:"k"`
}
type Sig3Bundle ¶
type Sig3Bundle struct { Inner *InnerLink `json:"i,omitempty"` Outer OuterLink `json:"o"` Sig *Sig `json:"s,omitempty"` }
Sig3Bundle is for storing sig3 links locally
func (Sig3Bundle) Export ¶
func (s Sig3Bundle) Export() (ret Sig3ExportJSON, err error)
Export a sig3 up to the server in base64'ed JSON format, as in a POST request.
type Sig3ExportJSON ¶
type Sig3ExportJSON struct { Inner string `json:"i,omitempty"` Outer string `json:"o,omitempty"` Sig string `json:"s,omitempty"` }
Sig3ExportJSON is for communicating with the API server.
func (Sig3ExportJSON) Import ¶
func (s Sig3ExportJSON) Import() (Generic, error)
Import from Sig3ExportJSON format (as sucked down from the server) into a Generic link type, that can be casted into the supported link types (like RotateKey). Returns an error if we failed to parse the input data, or if signature validation failed.