bundle

package
v0.0.0-...-a8b6a46 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: BSD-3-Clause, BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(bundle *stellar1.Bundle, secretKey stellar1.SecretKey, name string, makePrimary bool) (err error)

AddAccount adds an account to the bundle. Mutates `bundle`.

func Advance

func Advance(prevBundle stellar1.Bundle) stellar1.Bundle

Create the next bundle given a decrypted bundle.

func CreateNewAccount

func CreateNewAccount(bundle *stellar1.Bundle, name string, makePrimary bool) (pub stellar1.AccountID, err error)

CreateNewAccount generates a Stellar key pair and adds it to the bundle. Mutates `bundle`.

func Decrypt

Decrypt decrypts the stellar key bundle. Does not check invariants.

func Encrypt

Encrypt encrypts the stellar key bundle for the PUK. Returns the encrypted struct and a base64 encoding for posting to the server. Does not check invariants.

func NewInitialBundle

func NewInitialBundle(accountName string) (res stellar1.Bundle, err error)

func Unbox

func Unbox(decodeRes DecodeResult, visibleBundleB64 string,
	puk libkb.PerUserKeySeed) (res stellar1.Bundle, version stellar1.BundleVersion, err error)

Unbox decrypts the stellar key bundle. And decodes and verifies the visible bundle. Does not check the prev hash.

Types

type BoxResult

type BoxResult struct {
	Enc           stellar1.EncryptedBundle
	EncB64        string // base64 msgpack'd Enc
	VisB64        string // base64 msgpack'd Vis
	FormatVersion stellar1.BundleVersion
}

func Box

func Box(bundle stellar1.Bundle, pukGen keybase1.PerUserKeyGeneration,
	puk libkb.PerUserKeySeed) (res BoxResult, err error)

Box encrypts a stellar key bundle for a PUK.

type DecodeResult

type DecodeResult struct {
	Enc     stellar1.EncryptedBundle
	EncHash stellar1.Hash
}

func Decode

func Decode(encryptedBundleB64 string) (res DecodeResult, err error)

Decode decodes but does not decrypt the bundle. Returns `res` which is needed to decrypt and `res.Gen` specifies the decryption PUK.

Jump to

Keyboard shortcuts

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