> ## Documentation Index
> Fetch the complete documentation index at: https://cobo.com/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Secrets

> This operation imports the JSON data of Secrets created with the [Export Secrets](https://www.cobo.com/developers/v2/developer-tools/ucw-sdk/ucw-class/export-secrets) operation. The imported file will then be converted into a new passphrase-encrypted Secrets file, and TSS Node ID within the Secrets file will be returned.

<Tip>
  Try [Cobo WaaS Skill](/v2/guides/overview/cobo-waas-skill) in your AI coding assistant (Claude Code, Cursor, etc.). Describe your needs in natural language to auto-generate production-ready SDK code and debug faster 🚀
</Tip>

<CodeGroup>
  ```Swift iOS theme={null}
  public func importSecrets(jsonRecoverySecrets: String, exportPassphrase: String, newSecretsFile: String, newPassphrase: String) throws -> String
  ```

  ```Dart Flutter theme={null}
  Future<String> importSecrets(String jsonRecoverySecrets, String exportPassphrase, String newSecretsFile, String newPassphrase) async
  ```
</CodeGroup>

<RequestExample>
  ```Swift iOS theme={null}
  let jsonRecoverySecrets = "{}" // exported jsonRecoverySecrets
  let exportPassphrase = "wZdcycVuexvmgt7aMkaeA_2_ioCKrw!B" 
  let newSecretsFile = "secrets.db" 
  let newPassphrase = "d3hxNyoiAP@Lm!D7Qpo_hghdpgyc_r39" 

  do {
      let tssNodeID = try importSecrets(
          jsonRecoverySecrets: jsonRecoverySecrets,
          exportPassphrase: exportPassphrase,
          newSecretsFile: newSecretsFile,
          newPassphrase: newPassphrase
      )
      print("TSS Node ID: \(tssNodeID)")
  } catch {
      print("Error: \(error)")
  }
  ```

  ```Dart Flutter theme={null}
  const String jsonRecoverySecrets = "{}"; // exported jsonRecoverySecrets
  const String exportPassphrase = "wZdcycVuexvmgt7aMkaeA_2_ioCKrw!B";
  const String newSecretsFile = "secrets.db";
  const String newPassphrase = "d3hxNyoiAP@Lm!D7Qpo_hghdpgyc_r39";

  try {
      final tssNodeID = await importSecrets(
          jsonRecoverySecrets: jsonRecoverySecrets,
          exportPassphrase: exportPassphrase,
          newSecretsFile: newSecretsFile,
          newPassphrase: newPassphrase
      );
      print("TSS Node ID: $tssNodeID");
  } catch (error) {
      print("Error: $error");
  }
  ```
</RequestExample>

## Parameters

<ParamField path="jsonRecoverySecrets" type="string">
  The passphrase-encrypted JSON data of Secrets, created by the [Export Secrets](https://www.cobo.com/developers/v2/developer-tools/ucw-sdk/ucw-class/export-secrets) operations.
</ParamField>

<ParamField path="exportPassphrase" type="string">
  The passphrase used to decrypt the imported JSON data of Secrets.
</ParamField>

<ParamField path="newSecretsFile" type="string">
  The file path where the new Secrets will be stored.
</ParamField>

<ParamField path="newPassphrase" type="string">
  A passphrase for encrypting the new Secrets. It must be at least 16 characters long.
</ParamField>

## Response

<ResponseField name="tssNodeID" type="string">
  The TSS Node ID of the newly created Secrets.
</ResponseField>
