Methods
(static) decrypt(web3, account, pwd, encryptedKey, encryptedDocument, verbose) → {Promise.<String>}
This method can be used to decrypt document,
encrypted by `encrypt` method before.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
account |
String | Account of SS user | |
pwd |
String | Password of SS user | |
encryptedKey |
String | Document key encrypted with requester's public key | |
encryptedDocument |
String | Encrypted document data, returned by "encrypt" | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The decrypted secret document
- Type
- Promise.<String>
(static) encrypt(web3, account, pwd, encryptedKey, hexDocument, verbose) → {Promise.<String>}
You can use it to encrypt a small document.
Can be used after running a document key retrieval session
or a server- and document key generation session.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
account |
String | Account of SS user | |
pwd |
String | Password of SS user | |
encryptedKey |
String | Document key encrypted with requester's public key | |
hexDocument |
String | Hex encoded document data | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The encrypted secret document
- Type
- Promise.<String>
(static) generateDocumentKey(web3, account, pwd, serverKey, verbose) → {Promise.<String>}
Securely generates document key, so that it remains unknown to all key servers.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
account |
String | Account of SS user | |
pwd |
String | Password of SS user | |
serverKey |
String | The server key, returned by a server key generating session | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The document key
- Type
- Promise.<String>
(static) serversSetHash(web3, nodeIDs, verbose) → {Promise.<String>}
Computes the hash of nodes ids, required to compute nodes set signature
for manual `nodes set change` session.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
nodeIDs |
Array.<String> | node IDs of the "new set" | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The hash
- Type
- Promise.<String>
(static) shadowDecrypt(web3, account, pwd, decryptedSecret, commonPoint, decryptShadows, encryptedDocument, verbose) → {Promise.<String>}
This method can be used to decrypt document, encrypted by `encrypt` method before.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
account |
String | Account of SS user | |
pwd |
String | Password of SS user | |
decryptedSecret |
String | Field from `document key shadow retrieval session` result | |
commonPoint |
String | Field from `document key shadow retrieval session` result | |
decryptShadows |
String | Field from `document key shadow retrieval session` result | |
encryptedDocument |
String | Encrypted document data, returned by `encrypt` | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The decrypted secret document
- Type
- Promise.<String>
(static) signRawHash(web3, account, pwd, hash, verbose) → {Promise.<String>}
Computes recoverable ECDSA signatures which are used in the Secret Store:
signatures of server key id and signatures of nodes set hash.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
web3 |
Object | The web3 instance | |
account |
String | Account of SS user | |
pwd |
String | Password of SS user | |
hash |
String | The 256-bit hash to be signed (server key id or nodes set hash) | |
verbose |
Boolean | true | Whether to console log errors |
- Source:
Returns:
The signed hash
- Type
- Promise.<String>