Register and Generate Keys
Once you've initialised your NotVault library as detailed in the previous section, you're now ready to register an account and perform key generation.
To register an account and generate keys in a TypeScript environment, follow the steps below:
Import the necessary libraries:
Instantiate the NotVault class:
Register the contact ID and keys:
Use the
.register
method of thevault
instance to register the account. This method takes in several parameters and callback functions to facilitate the registration process.The parameters for this method include the wallet address, email or 0xWallet, and the secret key.
The callback functions include retrieving the public key from the crypto wallet, decrypting with the crypto wallet, and a success callback that logs the public key and contact ID.
With these steps, your account is registered in NotVault and your keys are properly set up for further operations. This registration process is an essential step for successfully using NotVault to perform secure and confidential operations on your data and tokens.
Last updated