Documentation ¶
Index ¶
- func AddAccount(bundle *stellar1.Bundle, secretKey stellar1.SecretKey, name string, ...) (err error)
- func Advance(prevBundle stellar1.Bundle) stellar1.Bundle
- func CreateNewAccount(bundle *stellar1.Bundle, name string, makePrimary bool) (pub stellar1.AccountID, err error)
- func Decrypt(encBundle stellar1.EncryptedBundle, puk libkb.PerUserKeySeed) (res stellar1.BundleSecretVersioned, err error)
- func Encrypt(bundle stellar1.BundleSecretVersioned, pukGen keybase1.PerUserKeyGeneration, ...) (res stellar1.EncryptedBundle, resB64 string, err error)
- func NewInitialBundle() (res stellar1.Bundle, err error)
- func Unbox(decodeRes DecodeResult, visibleBundleB64 string, puk libkb.PerUserKeySeed) (res stellar1.Bundle, version stellar1.BundleVersion, err error)
- type BoxResult
- type DecodeResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAccount ¶ added in v1.0.47
func AddAccount(bundle *stellar1.Bundle, secretKey stellar1.SecretKey, name string, makePrimary bool) (err error)
AddAccount adds an account to the bundle. Mutates `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 ¶
func Decrypt(encBundle stellar1.EncryptedBundle, puk libkb.PerUserKeySeed) (res stellar1.BundleSecretVersioned, err error)
Decrypt decrypts the stellar key bundle. Does not check invariants.
func Encrypt ¶
func Encrypt(bundle stellar1.BundleSecretVersioned, pukGen keybase1.PerUserKeyGeneration, puk libkb.PerUserKeySeed) (res stellar1.EncryptedBundle, resB64 string, err error)
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 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.