ejectPrivateKey

suspend fun ejectPrivateKey(clientBackupCiphertext: String? = null, orgBackupShare: String? = null, backupMethod: BackupMethods, backupConfigs: BackupConfigs? = null): String

Ejects the private key from the MPC (Multi-Party Computation) system.

This function retrieves the private key that has been securely stored and managed by the MPC system. It supports different backup methods and requires necessary backup information depending on the chosen method.

Return

The ejected private key as a String.

Parameters

clientBackupCiphertext

(Optional) The ciphertext of the client's backup share, required if the backup method is Client. This is an encrypted representation of a portion of the private key.

orgBackupShare

(Optional) The organization's backup share, required if the backup method is Organization. This represents a portion of the private key held by the organization.

backupMethod

The chosen method for backing up the private key. Must be one of the values defined in the BackupMethods enum (e.g., Password, Client, Organization).

backupConfigs

(Optional) Configuration settings for the backup process. If the backup method is Password, it must include the password storage configuration. It contains information such as the password used to protect the private key (if applicable).

Throws

If there is an underlying error from the MPC system during the private key ejection process.


suspend fun ejectPrivateKey(clientBackupCiphertext: String? = null, orgBackupShare: String? = null, orgSolanaBackupShare: String? = null, backupMethod: BackupMethods, backupConfigs: BackupConfigs? = null): Map<PortalNamespace, String>

Ejects the private keys managed by the MPC (Multi-Party Computation) system.

This function triggers the process of extracting the private keys from the MPC system. It requires specifying the backup method used for key recovery and may require providing associated backup data depending on the method.

Return

A Map where the keys are PortalNamespace (e.g., Ethereum, Solana) and the values are the corresponding ejected private keys as strings.

Parameters

clientBackupCiphertext

An optional ciphertext blob containing client-specific backup data. This is required if the chosen backup method utilizes client-side encryption. Defaults to null if not applicable.

orgBackupShare

An optional backup share generated by the organization. This is required if the backup method involves organizational participation. Defaults to null if not applicable.

orgSolanaBackupShare

An optional backup share generated by the organization, specifically for Solana accounts. This is required if the backup method involves organizational participation and involves Solana. Defaults to null if not applicable.

backupMethod

The BackupMethods used for key recovery (e.g., Password).

backupConfigs

Optional configuration parameters for the backup method. For BackupMethods.Password, it should contain the password for decryption. Defaults to null if not applicable or no additional configuration is needed.

Throws

if any error occurs during the key ejection process, including incorrect backup data or password.