Skip to main content
public func importSecrets(jsonRecoverySecrets: String, exportPassphrase: String, newSecretsFile: String, newPassphrase: String) throws -> String
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)")
}

Parameters

jsonRecoverySecrets
string
The passphrase-encrypted JSON data of Secrets, created by the Export Secrets operations.
exportPassphrase
string
The passphrase used to decrypt the imported JSON data of Secrets.
newSecretsFile
string
The file path where the new Secrets will be stored.
newPassphrase
string
A passphrase for encrypting the new Secrets. It must be at least 16 characters long.

Response

tssNodeID
string
The TSS Node ID of the newly created Secrets.