SecretStoreRpcApiClient

client/rpc~ SecretStoreRpcApiClient

new SecretStoreRpcApiClient(ssLocalAPIEndpoint)

Client for OpenEthereum's secretstore RPC API module. Should be used to communicate with a local node. Uses ethers.js providers.
Parameters:
Name Type Description
ssLocalAPIEndpoint String | ethers.providers.JsonRpcProvider The RPC endpoint of an OpenEthereum client. This should be a local node for trust reasons.
Source:

Methods

(async) decrypt(account, pwd, encryptedDocument, encryptedDocumentKey) → {Promise.<string>}

This method can be used to decrypt a document, encrypted by the encrypt() method before.
Parameters:
Name Type Description
account string The address of a SecretStore user.
pwd string The password of the SecretStore user for the account given.
encryptedDocument string The encrypted document data, returned by "encrypt" as hex string.
encryptedDocumentKey string The document key encrypted with requester’s public key, as hex string.
Source:

(async) encrypt(account, pwd, hexDocument, encryptedDocumentKey) → {Promise.<string>}

You can use it to encrypt a small document. An encryption key is needed, typically obtained from the store by running a document key retrieval session or a server- and document key generation session.
Parameters:
Name Type Description
account string The address of a SecretStore user.
pwd string The password of the SecretStore user for the account given.
hexDocument string Hex encoded document data.
encryptedDocumentKey string Document key encrypted with requester's public key, as a hex string.
Source:

(async) generateDocumentKey(account, pwd, serverKey) → {Promise.<ExternallyEncryptedDocumentKey>}

Securely generates a document key locally in a way that it remains unknown to all key servers.
Parameters:
Name Type Description
account string The address of a SecretStore user.
pwd string The password of the SecretStore user for the account given.
serverKey string The server key, returned by a server key generating session.
Source:

(async) serversSetHash(nodeIDs) → {Promise.<string>}

Computes the hash of node ids, required to compute a node-set signature for manual nodes set change session.
Parameters:
Name Type Description
nodeIDs Array.<string> List of hex-encoded node ID’s (public keys, enode addresses).
Source:

(async) shadowDecrypt(account, pwd, encryptedDocument, decryptedSecretOrDocumentKeyPortions, commonPoint, decryptShadows) → {Promise.<string>}

This method can be used to decrypt a document, encrypted by the encrypt() method before. Document key can be obtained by a document key shadow retrieval session.
Parameters:
Name Type Description
account string The address of a SecretStore user.
pwd string The password of the SecretStore user for the account given.
encryptedDocument string Encrypted document data, hex encoded, returned by encrypt().
decryptedSecretOrDocumentKeyPortions string | DocumentKeyPortions The hex-encoded decrypted secret string or document portions object of an encrypted document key.
commonPoint string The hex-encoded common point portion of an encrypted document key.
decryptShadows Array.<string> The hex-encoded encrypted point portions of an encrypted document key.
Source:

(async) signRawHash(account, pwd, rawhash) → {Promise.<string>}

Computes recoverable ECDSA signatures. Typically used for signatures of server key ID and signatures of nodes-set hash in the Secret Store.
Parameters:
Name Type Description
account string The address of a SecretStore user.
pwd string The password of the SecretStore user for the account given.
rawhash string A 256-bit hash to be signed as a hex string (with or without 0x prefix), e.g.: server key id or nodes-set hash.
Source: