diff --git a/src/Hyperledger.Aries/Hyperledger.Aries.csproj b/src/Hyperledger.Aries/Hyperledger.Aries.csproj
index a2e97bd9..2a237e7b 100644
--- a/src/Hyperledger.Aries/Hyperledger.Aries.csproj
+++ b/src/Hyperledger.Aries/Hyperledger.Aries.csproj
@@ -5,7 +5,9 @@
$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
-
+
+
+
@@ -13,7 +15,7 @@
-
+
diff --git a/src/Hyperledger.Aries/Ledger/V2/DefaultLedgerServiceV2.cs b/src/Hyperledger.Aries/Ledger/V2/DefaultLedgerServiceV2.cs
index 9f56b0c9..b56deab0 100644
--- a/src/Hyperledger.Aries/Ledger/V2/DefaultLedgerServiceV2.cs
+++ b/src/Hyperledger.Aries/Ledger/V2/DefaultLedgerServiceV2.cs
@@ -246,5 +246,55 @@ async Task SubmitAsync()
exceptionPredicate: (IndyVdrException e) => e.Message.Contains("PoolTimeout") ||
e.Message.Contains("Service unavailable"));
}
+
+
+ public async Task RegisterCustomAsync(IAgentContext context, string requestJson, TransactionCost paymentInfo = null)
+ {
+ var req = await LedgerApi.BuildCustomRequest(requestJson);
+
+ await SignAndSubmitRequestAsync(context, requestJson, req);
+ }
+
+ public async Task RegisterDisableAllTxnAuthorAgreementsAsync(IAgentContext context, string submitterDid)
+ {
+ var req = await LedgerApi.BuildDisableAllTxnAuthorAgreementsRequest(submitterDid);
+
+ await SignAndSubmitRequestAsync(context, submitterDid, req);
+ }
+
+ public async Task LookupdGetTxnAuthorAgreementRequestAsync(IAgentContext agentContext)
+ {
+ var req = await LedgerApi.BuildGetTxnAuthorAgreementRequestAsync();
+
+ return await SubmitRequestAsync(agentContext, req);
+ }
+
+ public async Task LookupTxnRequestAsync(IAgentContext agentContext, int ledgerType, int seqNo)
+ {
+ var req = await LedgerApi.BuildGetTxnRequestAsync(ledgerType, seqNo);
+
+ return await SubmitRequestAsync(agentContext, req);
+ }
+
+ public async Task BuildGetValidatorInfoRequestAsync(IAgentContext context, string submitterDid)
+ {
+ var req = await LedgerApi.BuildGetValidatorInfoRequestAsync(submitterDid);
+
+ return await SubmitRequestAsync(context, req);
+ }
+
+ public async Task RegisterTxnAuthorAgreementRequestAsync(IAgentContext context, string submitterDid, string text, string version, long ratificationTs, long retirementTs)
+ {
+ var req = await LedgerApi.BuildTxnAuthorAgreementRequestAsync(submitterDid, text, version, ratificationTs, retirementTs);
+
+ await SignAndSubmitRequestAsync(context, submitterDid, req);
+ }
+
+ public async Task RegisterRichSchemaRequestAsync(IAgentContext context, string submitterDid, string rsId, string rsContent, string rsName, string rsVersion, string rsType, string ver)
+ {
+ var req = await LedgerApi.BuildRichSchemaRequestAsync(submitterDid, rsId, rsContent, rsName, rsVersion, rsType, ver);
+
+ await SignAndSubmitRequestAsync(context, submitterDid, req);
+ }
}
}
diff --git a/src/Hyperledger.Aries/Properties/launchSettings.json b/src/Hyperledger.Aries/Properties/launchSettings.json
new file mode 100644
index 00000000..00687ee5
--- /dev/null
+++ b/src/Hyperledger.Aries/Properties/launchSettings.json
@@ -0,0 +1,10 @@
+{
+ "profiles": {
+ "Hyperledger.Aries": {
+ "commandName": "Project",
+ "environmentVariables": {
+ "PATH": "C:\\Rustlibs"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Hyperledger.Aries/Resolver/DefaultResolverService.cs b/src/Hyperledger.Aries/Resolver/DefaultResolverService.cs
new file mode 100644
index 00000000..cdf58844
--- /dev/null
+++ b/src/Hyperledger.Aries/Resolver/DefaultResolverService.cs
@@ -0,0 +1,33 @@
+using Hyperledger.Aries.Agents;
+using Hyperledger.Aries.Ledger;
+using indy_vdr_dotnet.libindy_vdr;
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hyperledger.Aries.Resolver
+{
+ public class DefaultResolverService : IResolverService
+ {
+ public async Task ResolveAsync(PoolAwaitable poolHandle, string did)
+ {
+ if (await poolHandle is IntPtr pHandle)
+ {
+ var response = await ResolverApi.ResolveAsync(pHandle, did);
+ return response;
+ }
+ throw new NotImplementedException("Unsupported request handle");
+ }
+ public async Task DereferenceAsync(PoolAwaitable poolHandle, string did_url)
+ {
+ if (await poolHandle is IntPtr pHandle)
+ {
+ var response = await ResolverApi.DereferenceAsync(pHandle, did_url);
+ return response;
+ }
+ throw new NotImplementedException("Unsupported request handle");
+ }
+ }
+}
diff --git a/src/Hyperledger.Aries/Resolver/IResolverService.cs b/src/Hyperledger.Aries/Resolver/IResolverService.cs
new file mode 100644
index 00000000..10f9d575
--- /dev/null
+++ b/src/Hyperledger.Aries/Resolver/IResolverService.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Hyperledger.Aries.Resolver
+{
+ public interface IResolverService
+ {
+ }
+}
diff --git a/src/Hyperledger.Aries/Revocation/Abstractions/IRevocationService.cs b/src/Hyperledger.Aries/Revocation/Abstractions/IRevocationService.cs
new file mode 100644
index 00000000..4da6e42d
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Abstractions/IRevocationService.cs
@@ -0,0 +1,15 @@
+using anoncreds_rs_dotnet.Models;
+using Hyperledger.Aries.Agents;
+using Hyperledger.Aries.Revocation.Models;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Hyperledger.Aries.Revocation.Abstractions
+{
+ public interface IRevocationService
+ {
+ Task RegisterRevocationRegistryDefinition(Profile profile, RevocationRegistryDefinition revRegDef);
+ }
+}
diff --git a/src/Hyperledger.Aries/Revocation/DefaultRevocationService.cs b/src/Hyperledger.Aries/Revocation/DefaultRevocationService.cs
new file mode 100644
index 00000000..79b0d594
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/DefaultRevocationService.cs
@@ -0,0 +1,89 @@
+using anoncreds_rs_dotnet.Anoncreds;
+using anoncreds_rs_dotnet.Models;
+using Hyperledger.Aries.Agents;
+using Hyperledger.Aries.Extensions;
+using Hyperledger.Aries.Revocation.Abstractions;
+using Hyperledger.Aries.Revocation.Models;
+using Hyperledger.Aries.Revocation.Utils;
+using Microsoft.Extensions.Options;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using static Hyperledger.Aries.Revocation.Models.RevRegDefinitionState;
+
+namespace Hyperledger.Aries.Revocation
+{
+ public class DefaultRevocationService :IRevocationService
+ {
+ private List registrars;
+ private Profile _profile;
+
+
+ public DefaultRevocationService(Profile profile)
+ {
+ _profile = profile;
+ }
+
+ public Profile Profile
+ {
+ // Accessor for the profile instance
+
+ get
+ {
+ if (!(_profile is AskarAnoncredsProfile))
+ {
+ throw new Exception("AnonCreds interface requires AskarAnoncreds profile");
+ }
+
+ return _profile;
+ }
+ }
+ public async Task CreateAndRegisterRevocationRegistryDefinitionAsync(Profile profile, string originDid, CredentialDefinition credDefObject, string credDefId, string tag, RegistryType revRegType, long maxCredNumber, string tailsDirPath)
+ {
+ var req = await RevocationApi.CreateRevocationRegistryDefinitionAsync(originDid, credDefObject, credDefId, tag, revRegType, maxCredNumber, tailsDirPath);
+ RevocationRegistryDefinition revRegDef = req.Item1;
+ RevocationRegistryDefinitionPrivate revRegDefPrivate = req.Item2;
+ RevRegDefResult result = await RegisterRevocationRegistryDefinition(profile, revRegDef);
+ return result;
+ }
+
+ public async Task RegisterRevocationRegistryDefinition(Profile profile, RevocationRegistryDefinition revRegDef)
+ {
+ RevRegDefResult result;
+ var registrar = await _registrar_for_identifier(revRegDef.IssuerId);
+ result = await registrar.RegisterRevocationRegistryDefinition(profile, revRegDef);
+ return result;
+ }
+
+ public async Task _registrar_for_identifier(string IssuerId)
+ {
+ List matchingRegistrars = new List();
+ foreach (var registrar in registrars)
+ {
+ if (await registrar.SupportsAsync(IssuerId))
+ {
+ matchingRegistrars.Add(registrar);
+ }
+ }
+
+ if (matchingRegistrars.Count == 0)
+ {
+ throw new AnonCredsRegistrationError($"No registrar available for identifier {IssuerId}");
+ }
+
+ if (matchingRegistrars.Count > 1)
+ {
+ throw new AnonCredsRegistrationError($"More than one registrar found for identifier {IssuerId}");
+ }
+
+ return matchingRegistrars[0];
+ }
+
+ }
+
+
+
+
+}
diff --git a/src/Hyperledger.Aries/Revocation/Enum/Enum.cs b/src/Hyperledger.Aries/Revocation/Enum/Enum.cs
new file mode 100644
index 00000000..35aeae7a
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Enum/Enum.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Hyperledger.Aries.Revocation.Enum
+{
+ public class Enum
+ {
+ }
+}
diff --git a/src/Hyperledger.Aries/Revocation/Models/AskarAnoncredsProfile.cs b/src/Hyperledger.Aries/Revocation/Models/AskarAnoncredsProfile.cs
new file mode 100644
index 00000000..290877ec
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Models/AskarAnoncredsProfile.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Hyperledger.Aries.Revocation.Models
+{
+ public class AskarAnoncredsProfile
+ {
+ }
+}
diff --git a/src/Hyperledger.Aries/Revocation/Models/BaseAnonCredsRegistrar.cs b/src/Hyperledger.Aries/Revocation/Models/BaseAnonCredsRegistrar.cs
new file mode 100644
index 00000000..0f17aa6f
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Models/BaseAnonCredsRegistrar.cs
@@ -0,0 +1,30 @@
+// Technology stack: C#
+// Framework: .NET
+
+using anoncreds_rs_dotnet.Models;
+using Hyperledger.Aries.Ledger.Models;
+using Hyperledger.Aries.Revocation.Models;
+using System;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+
+public abstract class BaseAnonCredsRegistrar
+{
+ // Base Anon Creds Handler.
+
+ public abstract Regex SupportedIdentifiersRegex { get; }
+
+ public async Task SupportsAsync(string identifier)
+ {
+ // Determine whether this registry supports the given identifier.
+ return SupportedIdentifiersRegex.IsMatch(identifier);
+ }
+
+ ///
+ /// Register a revocation registry definition on the registry.
+ ///
+ public abstract Task RegisterRevocationRegistryDefinition(Profile profile, RevocationRegistryDefinition revocationRegistryDefinition);
+
+
+}
diff --git a/src/Hyperledger.Aries/Revocation/Models/BaseInjector.cs b/src/Hyperledger.Aries/Revocation/Models/BaseInjector.cs
new file mode 100644
index 00000000..219c0293
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Models/BaseInjector.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Hyperledger.Aries.Revocation.Models
+{
+ public abstract class BaseInjector
+ {
+ ///
+ /// Get the provided instance of a given class identifier.
+ ///
+ /// The base class to retrieve an instance of
+ /// An optional mapping providing configuration to the provider
+ /// An instance of the base class, or null
+ public abstract T Inject(T baseCls, IDictionary settings = null);
+
+ ///
+ /// Get the provided instance of a given class identifier or default if not found.
+ ///
+ /// The base class to retrieve an instance of
+ /// An optional mapping providing configuration to the provider
+ /// Default return value if no instance is found
+ /// An instance of the base class, or null
+ public abstract T InjectOr(T baseCls, IDictionary settings = null);
+
+ ///
+ /// Produce a copy of the injector instance.
+ ///
+ /// A copy of the injector instance
+ public abstract BaseInjector Copy();
+
+
+ }
+}
diff --git a/src/Hyperledger.Aries/Revocation/Models/BaseSettings.cs b/src/Hyperledger.Aries/Revocation/Models/BaseSettings.cs
new file mode 100644
index 00000000..64e10e4e
--- /dev/null
+++ b/src/Hyperledger.Aries/Revocation/Models/BaseSettings.cs
@@ -0,0 +1,96 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Hyperledger.Aries.Revocation.Models
+{
+ public abstract class BaseSettings : IDictionary
+ {
+ // Base settings class
+
+ public abstract object GetValue(object defaultVal = null, params object[] varNames);
+
+ public virtual bool? GetBool(bool? defaultVal = null, params string[] varNames)
+ {
+ var value = GetValue(varNames, defaultVal);
+ if (value != null)
+ {
+ value = Convert.ToBoolean(value) && !new List { "false", "False", "0" }.Contains(value.ToString());
+ }
+
+ return value as bool?;
+ }
+
+ public virtual int? GetInt(int? defaultVal = null, params string[] varNames)
+ {
+ var value = GetValue(varNames, defaultVal);
+ if (value != null)
+ {
+ value = Convert.ToInt32(value);
+ }
+
+ return value as int?;
+ }
+
+ public virtual string GetStr(string defaultVal = null, params string[] varNames)
+ {
+ var value = GetValue(varNames, defaultVal);
+ if (value != null)
+ {
+ value = value.ToString();
+ }
+
+ return value as string;
+ }
+
+ public abstract void CopyTo(KeyValuePair[] array, int arrayIndex);
+
+ public abstract bool Contains(KeyValuePair item);
+
+ public abstract void Add(KeyValuePair item);
+
+ public abstract bool Remove(KeyValuePair item);
+
+ public abstract IEnumerator> GetEnumerator();
+
+ public abstract bool TryGetValue(string key, out object value);
+
+ public abstract bool ContainsKey(string key);
+
+ public abstract void Add(string key, object value);
+
+ public abstract bool Remove(string key);
+
+ public abstract void Clear();
+
+ public abstract ICollection Keys { get; }
+
+ public abstract ICollection