Ejemplo n.º 1
0
        public async Task <string> createCredentialRequest(
            string credOfferJson,
            string credDefJson,
            string linkSecret)
        {
            try
            {
                var credReq = await AnonCreds.ProverCreateCredentialReqAsync(
                    d_openWallet,
                    d_didController.getActiveDid(),
                    credOfferJson,
                    credDefJson,
                    linkSecret);

                // credReq: {CredentialRequestJson, CredentialRequestMetadataJson}
                string  json = JsonConvert.SerializeObject(credReq);
                JObject o    = new JObject();
                o["CredentialRequestJson"]         = JObject.Parse(credReq.CredentialRequestJson);
                o["CredentialRequestMetadataJson"] = JObject.Parse(credReq.CredentialRequestMetadataJson);
                json = o.ToString();
                PrettyPrintFacilitator pretty = new PrettyPrintFacilitator();
                json = pretty.dePrettyJsonMember(json, "CredentialRequestJson");
                json = pretty.dePrettyJsonMember(json, "CredentialRequestMetadataJson");
                return(json);
            }
            catch (Exception e)
            {
                return($"Error: {e.Message}");
            }
        }
Ejemplo n.º 2
0
        public async Task <string> listSchemas()
        {
            string res = await getRecord("schema", "{}",
                                         "{\"retrieveTotalCount\": true, \"retrieveType\": true, \"retrieveTags\": true}");

            PrettyPrintFacilitator pretty = new PrettyPrintFacilitator();

            return(pretty.dePrettyJsonMember(res, "value"));
        }