Documentation ¶
Index ¶
- Constants
- func ForcePublishNewTeamEKForTesting(mctx libkb.MetaContext, teamID keybase1.TeamID, merkleRoot libkb.MerkleRoot) (metadata keybase1.TeamEkMetadata, err error)
- func ForcePublishNewUserEKForTesting(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (metadata keybase1.UserEkMetadata, err error)
- func HandleNewTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (err error)
- func NewEphemeralStorageAndInstall(mctx libkb.MetaContext)
- func ServiceInit(mctx libkb.MetaContext)
- type DeviceEKMap
- type DeviceEKSeed
- type DeviceEKStorage
- func (s *DeviceEKStorage) ClearCache()
- func (s *DeviceEKStorage) Delete(mctx libkb.MetaContext, generation keybase1.EkGeneration) (err error)
- func (s *DeviceEKStorage) DeleteExpired(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
- func (s *DeviceEKStorage) ForceDeleteAll(mctx libkb.MetaContext, username libkb.NormalizedUsername) (err error)
- func (s *DeviceEKStorage) Get(mctx libkb.MetaContext, generation keybase1.EkGeneration) (deviceEK keybase1.DeviceEk, err error)
- func (s *DeviceEKStorage) GetAll(mctx libkb.MetaContext) (deviceEKs DeviceEKMap, err error)
- func (s *DeviceEKStorage) GetAllActive(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (metadatas []keybase1.DeviceEkMetadata, err error)
- func (s *DeviceEKStorage) ListAllForUser(mctx libkb.MetaContext) (all []string, err error)
- func (s *DeviceEKStorage) MaxGeneration(mctx libkb.MetaContext, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
- func (s *DeviceEKStorage) Put(mctx libkb.MetaContext, generation keybase1.EkGeneration, ...) (err error)
- func (s *DeviceEKStorage) SetLogPrefix(mctx libkb.MetaContext)
- type EKLib
- func (e *EKLib) BoxLatestTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, recipients []keybase1.UID) (teamEKBoxes *[]keybase1.TeamEkBoxMetadata, err error)
- func (e *EKLib) BoxLatestUserEK(mctx libkb.MetaContext, receiverKey libkb.NaclDHKeyPair, ...) (userEKBox *keybase1.UserEkBoxed, err error)
- func (e *EKLib) CleanupStaleUserAndDeviceEKs(mctx libkb.MetaContext) (err error)
- func (e *EKLib) ClearCaches(mctx libkb.MetaContext)
- func (e *EKLib) DeriveDeviceDHKey(seed keybase1.Bytes32) *libkb.NaclDHKeyPair
- func (e *EKLib) GetOrCreateLatestTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID) (teamEK keybase1.TeamEk, created bool, err error)
- func (e *EKLib) GetTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (teamEK keybase1.TeamEk, err error)
- func (e *EKLib) KeygenIfNeeded(mctx libkb.MetaContext) (err error)
- func (e *EKLib) NewDeviceEKNeeded(mctx libkb.MetaContext) (needed bool, err error)
- func (e *EKLib) NewEphemeralSeed() (seed keybase1.Bytes32, err error)
- func (e *EKLib) NewTeamEKNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID) (needed bool, err error)
- func (e *EKLib) NewUserEKNeeded(mctx libkb.MetaContext) (needed bool, err error)
- func (e *EKLib) OnLogin(mctx libkb.MetaContext) error
- func (e *EKLib) OnLogout(mctx libkb.MetaContext) error
- func (e *EKLib) PrepareNewTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (sig string, boxes *[]keybase1.TeamEkBoxMetadata, ...)
- func (e *EKLib) PrepareNewUserEK(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot, ...) (sig string, boxes []keybase1.UserEkBoxMetadata, ...)
- func (e *EKLib) PurgeCachesForTeamID(mctx libkb.MetaContext, teamID keybase1.TeamID)
- func (e *EKLib) PurgeCachesForTeamIDAndGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, ...)
- func (e *EKLib) Shutdown()
- func (e *EKLib) SignedDeviceEKStatementFromSeed(mctx libkb.MetaContext, generation keybase1.EkGeneration, ...) (statement keybase1.DeviceEkStatement, signedStatement string, err error)
- type EKType
- type EphemeralKeyError
- type TeamEKBoxMap
- type TeamEKBoxStorage
- func (s *TeamEKBoxStorage) ClearCache()
- func (s *TeamEKBoxStorage) Delete(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (err error)
- func (s *TeamEKBoxStorage) DeleteExpired(mctx libkb.MetaContext, teamID keybase1.TeamID, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
- func (s *TeamEKBoxStorage) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (teamEK keybase1.TeamEk, err error)
- func (s *TeamEKBoxStorage) GetAll(mctx libkb.MetaContext, teamID keybase1.TeamID) (teamEKs TeamEKMap, err error)
- func (s *TeamEKBoxStorage) MaxGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
- func (s *TeamEKBoxStorage) PurgeCacheForTeamID(mctx libkb.MetaContext, teamID keybase1.TeamID) (err error)
- func (s *TeamEKBoxStorage) Put(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (err error)
- type TeamEKBoxedResponse
- type TeamEKMap
- type TeamEKSeed
- type UserEKBoxMap
- type UserEKBoxStorage
- func (s *UserEKBoxStorage) ClearCache()
- func (s *UserEKBoxStorage) Delete(mctx libkb.MetaContext, generation keybase1.EkGeneration) (err error)
- func (s *UserEKBoxStorage) DeleteExpired(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
- func (s *UserEKBoxStorage) Get(mctx libkb.MetaContext, generation keybase1.EkGeneration, ...) (userEK keybase1.UserEk, err error)
- func (s *UserEKBoxStorage) GetAll(mctx libkb.MetaContext) (userEKs UserEKUnboxedMap, err error)
- func (s *UserEKBoxStorage) MaxGeneration(mctx libkb.MetaContext, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
- func (s *UserEKBoxStorage) Put(mctx libkb.MetaContext, generation keybase1.EkGeneration, ...) (err error)
- type UserEKBoxedResponse
- type UserEKSeed
- type UserEKUnboxedMap
Constants ¶
View Source
const ( DefaultHumanErrMsg = "This exploding message is not available to you" DeviceProvisionedAfterContentCreationErrMsg = "this device was created after the message was sent" DeviceCloneErrMsg = "cloned devices do not support exploding messages" )
View Source
const MemCacheLRUSize = 1000
View Source
const SkipKeygenNilMerkleRoot = "Skipping key generation, unable to fetch merkle root"
Variables ¶
This section is empty.
Functions ¶
func ForcePublishNewTeamEKForTesting ¶
func ForcePublishNewTeamEKForTesting(mctx libkb.MetaContext, teamID keybase1.TeamID, merkleRoot libkb.MerkleRoot) (metadata keybase1.TeamEkMetadata, err error)
func ForcePublishNewUserEKForTesting ¶
func ForcePublishNewUserEKForTesting(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (metadata keybase1.UserEkMetadata, err error)
func HandleNewTeamEK ¶
func HandleNewTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration) (err error)
func NewEphemeralStorageAndInstall ¶
func NewEphemeralStorageAndInstall(mctx libkb.MetaContext)
Creates a ephemeral key storage and installs it into G.
func ServiceInit ¶
func ServiceInit(mctx libkb.MetaContext)
Types ¶
type DeviceEKMap ¶
type DeviceEKMap map[keybase1.EkGeneration]keybase1.DeviceEk
type DeviceEKSeed ¶
func (*DeviceEKSeed) DeriveDHKey ¶
func (s *DeviceEKSeed) DeriveDHKey() *libkb.NaclDHKeyPair
type DeviceEKStorage ¶
func NewDeviceEKStorage ¶
func NewDeviceEKStorage(mctx libkb.MetaContext) *DeviceEKStorage
func (*DeviceEKStorage) ClearCache ¶
func (s *DeviceEKStorage) ClearCache()
func (*DeviceEKStorage) Delete ¶
func (s *DeviceEKStorage) Delete(mctx libkb.MetaContext, generation keybase1.EkGeneration) (err error)
func (*DeviceEKStorage) DeleteExpired ¶
func (s *DeviceEKStorage) DeleteExpired(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
func (*DeviceEKStorage) ForceDeleteAll ¶
func (s *DeviceEKStorage) ForceDeleteAll(mctx libkb.MetaContext, username libkb.NormalizedUsername) (err error)
func (*DeviceEKStorage) Get ¶
func (s *DeviceEKStorage) Get(mctx libkb.MetaContext, generation keybase1.EkGeneration) (deviceEK keybase1.DeviceEk, err error)
func (*DeviceEKStorage) GetAll ¶
func (s *DeviceEKStorage) GetAll(mctx libkb.MetaContext) (deviceEKs DeviceEKMap, err error)
func (*DeviceEKStorage) GetAllActive ¶
func (s *DeviceEKStorage) GetAllActive(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (metadatas []keybase1.DeviceEkMetadata, err error)
func (*DeviceEKStorage) ListAllForUser ¶
func (s *DeviceEKStorage) ListAllForUser(mctx libkb.MetaContext) (all []string, err error)
ListAllForUser lists the internal storage name of deviceEKs of the logged in user. This is used for logsend purposes to debug ek state.
func (*DeviceEKStorage) MaxGeneration ¶
func (s *DeviceEKStorage) MaxGeneration(mctx libkb.MetaContext, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
func (*DeviceEKStorage) Put ¶
func (s *DeviceEKStorage) Put(mctx libkb.MetaContext, generation keybase1.EkGeneration, deviceEK keybase1.DeviceEk) (err error)
func (*DeviceEKStorage) SetLogPrefix ¶
func (s *DeviceEKStorage) SetLogPrefix(mctx libkb.MetaContext)
type EKLib ¶
func NewEKLib ¶
func NewEKLib(mctx libkb.MetaContext) *EKLib
func (*EKLib) BoxLatestTeamEK ¶ added in v1.0.48
func (e *EKLib) BoxLatestTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, recipients []keybase1.UID) (teamEKBoxes *[]keybase1.TeamEkBoxMetadata, err error)
func (*EKLib) BoxLatestUserEK ¶ added in v1.0.47
func (e *EKLib) BoxLatestUserEK(mctx libkb.MetaContext, receiverKey libkb.NaclDHKeyPair, deviceEKGeneration keybase1.EkGeneration) (userEKBox *keybase1.UserEkBoxed, err error)
For device provisioning
func (*EKLib) CleanupStaleUserAndDeviceEKs ¶
func (e *EKLib) CleanupStaleUserAndDeviceEKs(mctx libkb.MetaContext) (err error)
func (*EKLib) ClearCaches ¶
func (e *EKLib) ClearCaches(mctx libkb.MetaContext)
func (*EKLib) DeriveDeviceDHKey ¶ added in v1.0.47
func (e *EKLib) DeriveDeviceDHKey(seed keybase1.Bytes32) *libkb.NaclDHKeyPair
func (*EKLib) GetOrCreateLatestTeamEK ¶
func (*EKLib) GetTeamEK ¶
func (e *EKLib) GetTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error)
Try to get the TeamEK for the given `generation`. If this fails and the `generation` is also the current maxGeneration, create a new teamEK.
func (*EKLib) KeygenIfNeeded ¶
func (e *EKLib) KeygenIfNeeded(mctx libkb.MetaContext) (err error)
func (*EKLib) NewDeviceEKNeeded ¶
func (e *EKLib) NewDeviceEKNeeded(mctx libkb.MetaContext) (needed bool, err error)
func (*EKLib) NewEphemeralSeed ¶ added in v1.0.47
func (*EKLib) NewTeamEKNeeded ¶
func (*EKLib) NewUserEKNeeded ¶
func (e *EKLib) NewUserEKNeeded(mctx libkb.MetaContext) (needed bool, err error)
func (*EKLib) PrepareNewTeamEK ¶ added in v1.0.48
func (e *EKLib) PrepareNewTeamEK(mctx libkb.MetaContext, teamID keybase1.TeamID, signingKey libkb.NaclSigningKeyPair, recipients []keybase1.UID) (sig string, boxes *[]keybase1.TeamEkBoxMetadata, newMetadata keybase1.TeamEkMetadata, myBox *keybase1.TeamEkBoxed, err error)
func (*EKLib) PrepareNewUserEK ¶ added in v1.0.48
func (e *EKLib) PrepareNewUserEK(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot, pukSeed libkb.PerUserKeySeed) (sig string, boxes []keybase1.UserEkBoxMetadata, newMetadata keybase1.UserEkMetadata, myBox *keybase1.UserEkBoxed, err error)
func (*EKLib) PurgeCachesForTeamID ¶
func (e *EKLib) PurgeCachesForTeamID(mctx libkb.MetaContext, teamID keybase1.TeamID)
func (*EKLib) PurgeCachesForTeamIDAndGeneration ¶
func (e *EKLib) PurgeCachesForTeamIDAndGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration)
func (*EKLib) SignedDeviceEKStatementFromSeed ¶ added in v1.0.47
func (e *EKLib) SignedDeviceEKStatementFromSeed(mctx libkb.MetaContext, generation keybase1.EkGeneration, seed keybase1.Bytes32, signingKey libkb.GenericKey) (statement keybase1.DeviceEkStatement, signedStatement string, err error)
type EphemeralKeyError ¶
func (EphemeralKeyError) Error ¶
func (e EphemeralKeyError) Error() string
func (EphemeralKeyError) HumanError ¶
func (e EphemeralKeyError) HumanError() string
type TeamEKBoxMap ¶
type TeamEKBoxMap map[keybase1.EkGeneration]keybase1.TeamEkBoxed
type TeamEKBoxStorage ¶
We cache TeamEKBoxes from the server in a LRU and a persist to a local KVStore.
func NewTeamEKBoxStorage ¶
func NewTeamEKBoxStorage() *TeamEKBoxStorage
func (*TeamEKBoxStorage) ClearCache ¶
func (s *TeamEKBoxStorage) ClearCache()
func (*TeamEKBoxStorage) Delete ¶
func (s *TeamEKBoxStorage) Delete(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration) (err error)
func (*TeamEKBoxStorage) DeleteExpired ¶
func (s *TeamEKBoxStorage) DeleteExpired(mctx libkb.MetaContext, teamID keybase1.TeamID, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
func (*TeamEKBoxStorage) Get ¶
func (s *TeamEKBoxStorage) Get(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration, contentCtime *gregor1.Time) (teamEK keybase1.TeamEk, err error)
func (*TeamEKBoxStorage) GetAll ¶
func (s *TeamEKBoxStorage) GetAll(mctx libkb.MetaContext, teamID keybase1.TeamID) (teamEKs TeamEKMap, err error)
func (*TeamEKBoxStorage) MaxGeneration ¶
func (s *TeamEKBoxStorage) MaxGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
func (*TeamEKBoxStorage) PurgeCacheForTeamID ¶
func (s *TeamEKBoxStorage) PurgeCacheForTeamID(mctx libkb.MetaContext, teamID keybase1.TeamID) (err error)
func (*TeamEKBoxStorage) Put ¶
func (s *TeamEKBoxStorage) Put(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration, teamEKBoxed keybase1.TeamEkBoxed) (err error)
type TeamEKBoxedResponse ¶
type TeamEKBoxedResponse struct { Result *struct { Box string `json:"box"` UserEKGeneration keybase1.EkGeneration `json:"user_ek_generation"` Sig string `json:"sig"` } `json:"result"` }
type TeamEKSeed ¶
func (*TeamEKSeed) DeriveDHKey ¶
func (s *TeamEKSeed) DeriveDHKey() *libkb.NaclDHKeyPair
type UserEKBoxMap ¶
type UserEKBoxMap map[keybase1.EkGeneration]keybase1.UserEkBoxed
type UserEKBoxStorage ¶
We cache UserEKBoxes from the server in memory and a persist to a local KVStore.
func NewUserEKBoxStorage ¶
func NewUserEKBoxStorage() *UserEKBoxStorage
func (*UserEKBoxStorage) ClearCache ¶
func (s *UserEKBoxStorage) ClearCache()
func (*UserEKBoxStorage) Delete ¶
func (s *UserEKBoxStorage) Delete(mctx libkb.MetaContext, generation keybase1.EkGeneration) (err error)
func (*UserEKBoxStorage) DeleteExpired ¶
func (s *UserEKBoxStorage) DeleteExpired(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (expired []keybase1.EkGeneration, err error)
func (*UserEKBoxStorage) Get ¶
func (s *UserEKBoxStorage) Get(mctx libkb.MetaContext, generation keybase1.EkGeneration, contentCtime *gregor1.Time) (userEK keybase1.UserEk, err error)
func (*UserEKBoxStorage) GetAll ¶
func (s *UserEKBoxStorage) GetAll(mctx libkb.MetaContext) (userEKs UserEKUnboxedMap, err error)
func (*UserEKBoxStorage) MaxGeneration ¶
func (s *UserEKBoxStorage) MaxGeneration(mctx libkb.MetaContext, includeErrs bool) (maxGeneration keybase1.EkGeneration, err error)
func (*UserEKBoxStorage) Put ¶
func (s *UserEKBoxStorage) Put(mctx libkb.MetaContext, generation keybase1.EkGeneration, userEKBoxed keybase1.UserEkBoxed) (err error)
type UserEKBoxedResponse ¶
type UserEKBoxedResponse struct { Result *struct { Box string `json:"box"` DeviceEKGeneration keybase1.EkGeneration `json:"device_ek_generation"` Sig string `json:"sig"` } `json:"result"` }
type UserEKSeed ¶
func (*UserEKSeed) DeriveDHKey ¶
func (s *UserEKSeed) DeriveDHKey() *libkb.NaclDHKeyPair
type UserEKUnboxedMap ¶
type UserEKUnboxedMap map[keybase1.EkGeneration]keybase1.UserEk
Click to show internal directories.
Click to hide internal directories.