This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
144 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using aries_askar_dotnet.AriesAskar; | ||
using aries_askar_dotnet.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hyperledger.Aries.AskarStore | ||
{ | ||
public class DefaultStoreService : IStoreService | ||
{ | ||
public Task<string> GenerateRawKeyAsync(string Seed = null) | ||
{ | ||
var key = StoreApi.GenerateRawKeyAsync(Seed); | ||
return key; | ||
} | ||
|
||
public async Task<Store> OpenStore(Store store, bool provision = false) | ||
{ | ||
if (provision) | ||
{ | ||
store = await StoreApi.ProvisionAsync(store.specUri); | ||
} | ||
else | ||
{ | ||
store = await StoreApi.OpenAsync(store.specUri); | ||
} | ||
|
||
return store; | ||
} | ||
|
||
public Task<bool> RemoveStoreAsync(Store store) | ||
{ | ||
return StoreApi.CloseAsync(store); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using aries_askar_dotnet.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hyperledger.Aries.AskarStore | ||
{ | ||
public interface IStoreService | ||
{ | ||
Task<bool> RemoveStoreAsync(Store store); | ||
Task<Store> OpenStore(Store store, bool provision =false); | ||
Task<string> GenerateRawKeyAsync(string Seed = null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/Hyperledger.Aries/Resolver/Abstrations/IResolverService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Hyperledger.Aries.Ledger; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hyperledger.Aries.Resolver.Abstrations | ||
{ | ||
public interface IResolverService | ||
{ | ||
public Task<string> ResolveAsync(PoolAwaitable poolHandle, string did); | ||
public Task<string> DereferenceAsync(PoolAwaitable poolHandle, string did_url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Hyperledger.Aries/Revocation/DefaultRegistryService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using anoncreds_rs_dotnet.Models; | ||
using Hyperledger.Aries.Revocation.Abstractions; | ||
using Hyperledger.Aries.Revocation.Models; | ||
using Hyperledger.Aries.Revocation.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hyperledger.Aries.Revocation | ||
{ | ||
public class DefaultRegistryService : IRegistryService | ||
{ | ||
private List<BaseAnonCredsRegistrar> registrars; | ||
public async Task<RevRegDefResult> RegisterRevocationRegistryDefinition(RevocationRegistryDefinition revRegDef) | ||
{ | ||
RevRegDefResult result; | ||
var registrar = await _registrar_for_identifier(revRegDef.IssuerId); | ||
result = await registrar.RegisterRevocationRegistryDefinition(revRegDef); | ||
return result; | ||
} | ||
|
||
public async Task<BaseAnonCredsRegistrar> _registrar_for_identifier(string IssuerId) | ||
{ | ||
List<BaseAnonCredsRegistrar> matchingRegistrars = new List<BaseAnonCredsRegistrar>(); | ||
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]; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/Hyperledger.Aries/Revocation/Models/AskarAnoncredsProfile.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.