Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnpackRecoveryKey = errors.New("sbc/msgpack: recovery key unpack failed") ErrUnpackRecoveryKeyV2 = errors.New("sbc/msgpack: recovery key version 2 unpack failed") ErrUnpackBlobPayload = errors.New("sbc/msgpack: blob payload unpack failed") ErrUnpackBackupPayload = errors.New("sbc/msgpack: backup payload unpack failed") )
View Source
var ( ErrInvalidMid = errors.New("sbc: invalid mid") ErrInvalidPasscode = errors.New("sbc: invalid passcode") )
Functions ¶
This section is empty.
Types ¶
type BackupKeyType ¶ added in v0.16.0
type BackupKeyType int
const ( BackupKeyTypeE2eeKey BackupKeyType = iota + 1 BackupKeyTypeBackupPin BackupKeyTypeBackupMasterKey )
type BackupKeys ¶ added in v0.12.0
func (*BackupKeys) HasMasterKey ¶ added in v0.19.0
func (k *BackupKeys) HasMasterKey() bool
func (*BackupKeys) HasPasscode ¶ added in v0.19.0
func (k *BackupKeys) HasPasscode() bool
type E2eeKey ¶ added in v0.12.0
type E2eeKey struct {
KeyID int32
E2eeKey *E2eeKeyData
}
type E2eeKeyData ¶ added in v0.14.0
type PayloadSecret ¶ added in v0.19.0
type PayloadSecret struct {
Type PayloadType
Key []byte
}
type PayloadType ¶ added in v0.16.0
type PayloadType uint
const ( PayloadTypeE2eeKey PayloadType = iota + 1 PayloadTypeInitialFullSyncKey )
type RestoreClaim ¶
type RestoreClaim struct {
// contains filtered or unexported fields
}
func CreateClaimFromSharedSecret ¶
func CreateClaimFromSharedSecret(secret []byte) *RestoreClaim
func CreateFromPin ¶
func CreateFromPin(mid, passcode, path string) (*RestoreClaim, error)
CreateFromPin generates a claim using the user's internal identifier, a 6-digit passcode, and a service certificate.
func CreateFromPinWithServerTime ¶
func CreateFromPinWithServerTime(mid, passcode, path string, timestamp uint64) (*RestoreClaim, error)
func (*RestoreClaim) Claim ¶
func (c *RestoreClaim) Claim() []byte
func (*RestoreClaim) Restore ¶
func (c *RestoreClaim) Restore(key, payload []byte) (*BackupKeys, error)
func (*RestoreClaim) Seed ¶
func (c *RestoreClaim) Seed() []byte
type RestoreClaimV3 ¶ added in v0.18.0
type RestoreClaimV3 struct {
// contains filtered or unexported fields
}
func CreateClaimV3FromSeed ¶ added in v0.18.0
func CreateClaimV3FromSeed(mid string, seed []byte) *RestoreClaimV3
func CreateFromPassword ¶ added in v0.18.0
func CreateFromPassword(mid, password, path string) (*RestoreClaimV3, error)
func (*RestoreClaimV3) Claim ¶ added in v0.18.0
func (v *RestoreClaimV3) Claim() []byte
func (*RestoreClaimV3) Restore ¶ added in v0.18.0
func (v *RestoreClaimV3) Restore(key, payload []byte) (*PayloadSecret, error)
func (*RestoreClaimV3) Seed ¶ added in v0.18.0
func (v *RestoreClaimV3) Seed() []byte
type SecretFactor ¶ added in v0.13.0
type SecretFactor struct {
// contains filtered or unexported fields
}
func (*SecretFactor) RestoreClaim ¶ added in v0.18.0
func (f *SecretFactor) RestoreClaim(path string) (*RestoreClaimV3, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.