Create Key Pair

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

type
string
required

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_pair
object
required

The key pair object created in the createKeyPair method.

password
string
required

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();