sbc

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

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

type BackupKeys struct {
	E2eeKeys  E2eeKeys
	Passcode  string
	MasterKey []byte
}

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 E2eeKeyData struct {
	CreatedTime int64  `json:"created_time"`
	Version     int32  `json:"version"`
	PrivateKey  string `json:"encoded_private_key"`
	PublicKey   string `json:"encoded_public_key"`
}

type E2eeKeys added in v0.14.0

type E2eeKeys []*E2eeKey

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)

Directories

Path Synopsis
internal
argon2
Package argon2 implements the key derivation function Argon2.
Package argon2 implements the key derivation function Argon2.
sum

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL