Members
(constant) deriveAuthenticationPrivateKey
Derives and returns the private key from a pepper and a nonce.
The generated private key is used to authenticate in applications.
```js
const pepper = derivePepperFromSeed( seed, nonce );
const privateKey = deriveAuthenticationPrivateKey( pepper, applicationId );
```
(constant) derivePepperFromSeed
Derives and returns a pepper from a seed and a nonce.
(constant) deriveUserPrivateKey
Derives and returns the private key from a pepper and a nonce.
```js
const pepper = derivePepperFromSeed( seed, nonce );
const privateKey = deriveUserPrivateKey( pepper, applicationId );
```
(constant) getMicroBlock
Returns information on the micro-block associated with the provided hash.
(constant) getMicroChain
Returns information about the micro-chain specified by the provided id.
(constant) getPublicKey
Derives and returns the public key from the public key.
(constant) getSection
Returns a section from a block.
(constant) getWordListFromSeed
Retrieves and returns a world list from a seed.
(constant) processRecord
Processes a provided flow to extract a record.
(constant) sign
Returns the signature of the data, signed by the provided private signature key.
Methods
deriveAesKeyFromPassword(password) → {Promise.<Uint8Array>}
Derives and returns a 256-bits AES key from the provided password.
Parameters:
Name | Type | Description |
---|---|---|
password |
string | The password from which the password is derived. |
Returns:
The AES key.
- Type
- Promise.<Uint8Array>
Example
const password = "myPassword";
const key = await deriveAesKeyFromPassword( password );
generateWordList(nbWords) → {Array.<string>}
Generates and returns a list of words.
Parameters:
Name | Type | Description |
---|---|---|
nbWords |
number | The number of words to generate. |
Returns:
A list containing the generated words, with a size of nbWords.
- Type
- Array.<string>
getSeedFromWordList(words) → {Uint8Array}
Derives and returns a seed from a list of words.
Parameters:
Name | Type | Description |
---|---|---|
words |
Array.<string> | The words from which the seed is derived. |
Returns:
The seed.
- Type
- Uint8Array
loadPublicDataFromMicroBlock(applicationId, flowId, nonce) → {Promise.<{valid: boolean, msg: any, appDef: object}>}
Returns a promise returning a public data the micro block at position `nonce` in the micro-chain having flowId identifier
based in the application and associated with the applicationId.
Parameters:
Name | Type | Description |
---|---|---|
applicationId |
The id of the application containing the designated micro-block. | |
flowId |
The id of the flow containing the designated micro-block. | |
nonce |
The position of the designated micro-block (should start at 1). |
Returns:
- Type
- Promise.<{valid: boolean, msg: any, appDef: object}>