public async Task <string> holderSharedSecretProvide(
            string doctorProofJson, string issuerWalletName)
        {
            bool res = await DoctorProofFacilitator.verifyDoctorProof(
                doctorProofJson);

            if (!res)
            {
                return("The doctor proof json that was provided is not valid!");
            }

            GovernmentSchemasModel model =
                GovernmentSchemasModel.importFromJsonFile();
            string json      = model.shared_secret_schema;
            string schema_id = GovernmentSchemasModel.getSchemaId(json);

            // return array with credentials json
            json = await getCredentials("{\"schema_id\": \"" + schema_id + "\"}");

            JArray a = JArray.Parse(json);

            for (int idx = 0; idx < a.Count; ++idx)
            {
                JObject cred = (JObject)a[idx];
                if (cred["attrs"]["secret_issuer"].ToString() == issuerWalletName)
                {
                    return(cred["attrs"]["secret"].ToString());
                }
            }
            return("No secret found for specified identifier");
        }
        public async Task <string> getEHRCredentials()
        {
            GovernmentSchemasModel model =
                GovernmentSchemasModel.importFromJsonFile();
            string schemaId =
                GovernmentSchemasModel.getSchemaId(
                    model.electronic_health_record_schema);

            return(await getCredentials("{\"schema_id\": \""
                                        + schemaId + "\"}"));
        }
        public async Task <string> getTrustedParties(
            string doctorProofJson, string issuer)
        {
            bool res = await DoctorProofFacilitator.verifyDoctorProof(
                doctorProofJson);

            if (!res)
            {
                return("The doctor proof json that was provided is not valid!");
            }

            GovernmentSchemasModel model =
                GovernmentSchemasModel.importFromJsonFile();
            string schemaId =
                GovernmentSchemasModel.getSchemaId(
                    model.emergency_trusted_parties_schema);

            JArray credentials = await getCredentialsArray("{\"schema_id\": \""
                                                           + schemaId + "\"}");

            List <string> secretOwners = new List <string>();
            string        min          = "";

            foreach (var cred in credentials)
            {
                if (cred["attrs"]["secret_issuer"].ToString() == issuer)
                {
                    secretOwners.Add(cred["attrs"]["secret_owner"].ToString());
                    min = cred["attrs"]["min"].ToString();
                }
            }

            if (secretOwners.Count == 0)
            {
                return("No trusted parties are know for " + issuer);
            }

            string output = "Trusted Parties of " + issuer + ":\n[\n";

            foreach (string owner in secretOwners)
            {
                output += owner + ",\n";
            }

            output += "A minimum of " + min + " shared secrets is required to reconstruct the original secret.";

            return(output);
        }