Home
Key Pairs / Wallets

Create Key Pair

This allows you to create an RSA or ECSDA key pair.

typerequired
string

Either rsa or ecsda

sg.createKeyPair(type);

Upload Key Pair

This allows you to save this key pair with SelfGuard, encrypted with a password

key_pairrequired
object

The key pair object created in the createKeyPair method.

passwordrequired
string

A password that will be used to encrypt the private key.

await sg.uploadKeyPair(key_pair, password);

Get Key Pairs

This allows you to retrieve all encrypted key pairs stored with this account. Each pair can be decrypted using the decryptWithPassword helper function.

await sg.getKeyPairs();