public async Task <string> createEmergencySharedSecrets(int min, int total)
        {
            string bigSecret = await backupEHR();

            List <string> secrets = SecretSharingFacilitator.createSharedSecret(
                bigSecret, min, total);

            int idx = 0;

            foreach (string secret in secrets)
            {
                await addRecord(
                    "shared-secret",
                    secret,
                    "ESS",
                    createSharedSecretTagJson(++idx, min, total));
            }
            return((string) await listSharedSecrets());
        }
        public async Task <string> createWalletBackupSharedSecrets(
            int min, int total)
        {
            string list = await listSharedSecrets();

            if (list != "0")
            {
                throw new Exception("There allready exist shared secrets.");
            }

            if (!IOFacilitator.fileExists(WalletBackupModel.filePath(d_identifier)))
            {
                throw new Exception("There must be an IPFS backup of the wallet. No IPFS export JSON file was found for this wallet.");
            }

            WalletBackupModel model =
                WalletBackupModel.importFromJsonFile(d_identifier);

            List <string> secrets = SecretSharingFacilitator.createSharedSecret(
                model.toJson(), min, total);

            int idx = 0;

            foreach (string secret in secrets)
            {
                await addRecord(
                    "shared-secret",
                    secret,
                    "WBSS",
                    createSharedSecretTagJson(++idx, min, total));
            }

            list = await listSharedSecrets();

            return(list);
        }