Constructor
new UnlockedSeedBundle(secret, appData)
You should not use this constructor directly.
Use one of:
- `UnlockedKeyBundle.newRandom(appData)`
- `UnlockedKeyBundle.fromLocked(encodedBytes)`
WARNING: see class-level note about zeroing / secrets.
Parameters:
Name | Type | Description |
---|---|---|
secret |
PrivSecretBuf | parseSecret(Uint8Array) |
appData |
object | appData to associate with bundle |
Members
appData :object
any app / user data to provide context for this particular seed
Type:
- object
signPubKey :string
the base64 encoded public key associated with this seed
Type:
- string
Methods
(static) fromLocked(encodedBytes) → {Array.<LockedSeedCipher>}
Extract the LockedSeedCipher list capable of decrypting
an UnlockedSeedBundle from an encrypted SeedBundle.
WARNING: see class-level note about zeroing / secrets.
Parameters:
Name | Type | Description |
---|---|---|
encodedBytes |
Uint8Array | encoded bytes to decode / decrypt |
Returns:
- Type
- Array.<LockedSeedCipher>
(static) newRandom(appData) → {UnlockedSeedBundle}
Construct a new completely random root seed with given app / user data.
WARNING: see class-level note about zeroing / secrets.
Parameters:
Name | Type | Description |
---|---|---|
appData |
object | appData to associate with bundle |
Returns:
- Type
- UnlockedSeedBundle
derive(subkeyId, appData) → {UnlockedSeedBundle}
Derive a subkey / seed from this seed bundle seed.
WARNING: see class-level note about zeroing / secrets.
Parameters:
Name | Type | Description |
---|---|---|
subkeyId |
number | derivation subkeyId |
appData |
object | appData to associate with subseed bundle |
Returns:
- Type
- UnlockedSeedBundle
lock(seedCipherList) → {Uint8Array}
Encrypt this seed into seed bundle bytes with given
seedCipherList - note, all seedCiphers will be zeroed.
WARNING: see class-level note about zeroing / secrets.
Parameters:
Name | Type | Description |
---|---|---|
seedCipherList |
Array.<SeedCipher> | list of seed ciphers to encrypt into the bundle |
Returns:
- Type
- Uint8Array
setAppData(appData)
You may change the app/user data with this function.
Parameters:
Name | Type | Description |
---|---|---|
appData |
object | appData to associate with bundle |
zero()
Zero out the internal secret buffers.
WARNING: see class-level note about zeroing / secrets.