Skip to main content

Export Key


Users can at any time request to "export" their keys into a private key.

Step 1 : Create Session


Step 2 : Perform Export


  • Call trioSession.export() with the keyshare which returns Result of Success with Keyshare bytes as Data or Failure with error.

Example


Example.swift
func exportPrivateKey(keyshare: Data, trioSession: TrioSession) async -> Data?
{
let result = await trioSession.export(
keyshare: keyshare)
// returns nil if operation fails
switch result {
case .success(let dataBytes):
do {
// do something with Encrypted Keyshare bytes
Swift.print(dataBytes)
return dataBytes
}
case .failure(let error):
do {
// show error to user or abort process
Swift.print(error)
return nil
}
}
}

  • keyshare: The client's (In this case mobile) share of the MPC wallet.