Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from tatmanblue/wallet-records
Browse files Browse the repository at this point in the history
Adding support for wallet records
  • Loading branch information
tatmanblue committed Jun 22, 2020
2 parents 47a1485 + f2ab2cf commit 7cadd31
Show file tree
Hide file tree
Showing 20 changed files with 138 additions and 76 deletions.
6 changes: 6 additions & 0 deletions ADDITIONAL INFORMATION.md
@@ -1 +1,7 @@
https://en.wikipedia.org/wiki/Boneh%E2%80%93Lynn%E2%80%93Shacham

dotnet nuget project
https://www.nuget.org/packages/IndyDotNet/

dotnet nuget instructions
https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli
4 changes: 2 additions & 2 deletions DotNetPay/DotNetPay.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net45|AnyCPU'">
Expand Down
8 changes: 4 additions & 4 deletions IndyDotNet/AnonCreds/Anon.cs
Expand Up @@ -19,7 +19,7 @@ internal class CredentialSearch : IDisposable
/// Gets the handle.
/// </summary>
/// <value>The handle.</value>
public IntPtr Handle { get; }
public int Handle { get; }

/// <summary>
/// Gets the total count of items.
Expand All @@ -36,7 +36,7 @@ internal class CredentialSearch : IDisposable
/// <param name="handle">Handle.</param>
/// <param name="total_count">Total count.</param>
/// <param name="proofRequest">If set to <c>true</c> proof request.</param>
internal CredentialSearch(IntPtr handle, int? total_count, bool proofRequest)
internal CredentialSearch(int handle, int? total_count, bool proofRequest)
{
ProofRequest = proofRequest;
TotalCount = total_count;
Expand Down Expand Up @@ -497,7 +497,7 @@ private static void ProverGetCredentialsCallbackMethod(int xcommand_handle, int
#if __IOS__
[MonoPInvokeCallback(typeof(ProverSearchCredentialsCompletedDelegate))]
#endif
private static void ProverSearchCredentialsCallbackMethod(int xcommand_handle, int err, IntPtr search_handle, int total_count)
private static void ProverSearchCredentialsCallbackMethod(int xcommand_handle, int err, int search_handle, int total_count)
{
var taskCompletionSource = PendingCommands.Remove<CredentialSearch>(xcommand_handle);

Expand Down Expand Up @@ -525,7 +525,7 @@ private static void ProverFetchCredentialsCallbackMethod(int xcommand_handle, in
#if __IOS__
[MonoPInvokeCallback(typeof(ProverSearchCredentialsForProofReqCompletedDelegate))]
#endif
private static void ProverSearchCredentialsForProofRequestCallbackMethod(int xcommand_handle, int err, IntPtr search_handle)
private static void ProverSearchCredentialsForProofRequestCallbackMethod(int xcommand_handle, int err, int search_handle)
{
var taskCompletionSource = PendingCommands.Remove<CredentialSearch>(xcommand_handle);

Expand Down
40 changes: 20 additions & 20 deletions IndyDotNet/AnonCreds/SDK.cs

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions IndyDotNet/Did/SDK.cs
Expand Up @@ -16,7 +16,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_create_and_store_my_did(int command_handle, IntPtr wallet_handle, string did_info, CreateAndStoreMyDidCompletedDelegate cb);
internal static extern int indy_create_and_store_my_did(int command_handle, int wallet_handle, string did_info, CreateAndStoreMyDidCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_create_and_store_my_did.
Expand All @@ -38,7 +38,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_replace_keys_start(int command_handle, IntPtr wallet_handle, string did, string key_info, ReplaceKeysStartCompletedDelegate cb);
internal static extern int indy_replace_keys_start(int command_handle, int wallet_handle, string did, string key_info, ReplaceKeysStartCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_replace_keys_start.
Expand All @@ -57,7 +57,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_replace_keys_apply(int command_handle, IntPtr wallet_handle, string did, IndyMethodCompletedDelegate cb);
internal static extern int indy_replace_keys_apply(int command_handle, int wallet_handle, string did, IndyMethodCompletedDelegate cb);

/// <summary>
/// Saves their DID for a pairwise connection in a secured Wallet,
Expand All @@ -69,7 +69,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_store_their_did(int command_handle, IntPtr wallet_handle, string identity_json, IndyMethodCompletedDelegate cb);
internal static extern int indy_store_their_did(int command_handle, int wallet_handle, string identity_json, IndyMethodCompletedDelegate cb);

/// <summary>
/// Returns ver key (key id) for the given DID.
Expand All @@ -81,7 +81,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_key_for_did(int command_handle, IntPtr pool_handle, IntPtr wallet_handle, string did, DidKeyForDidCompletedDelegate cb);
internal static extern int indy_key_for_did(int command_handle, int pool_handle, int wallet_handle, string did, DidKeyForDidCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_key_for_did.
Expand All @@ -100,7 +100,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_key_for_local_did(int command_handle, IntPtr wallet_handle, string did, DidKeyForLocalDidCompletedDelegate cb);
internal static extern int indy_key_for_local_did(int command_handle, int wallet_handle, string did, DidKeyForLocalDidCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_key_for_local_did.
Expand All @@ -121,7 +121,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_set_endpoint_for_did(int command_handle, IntPtr wallet_handle, string did, string address, string transport_key, IndyMethodCompletedDelegate cb);
internal static extern int indy_set_endpoint_for_did(int command_handle, int wallet_handle, string did, string address, string transport_key, IndyMethodCompletedDelegate cb);

/// <summary>
/// Gets the endpoint information for the given DID.
Expand All @@ -133,7 +133,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_get_endpoint_for_did(int command_handle, IntPtr wallet_handle, IntPtr pool_handle, string did, DidGetEndpointForDidCompletedDelegate cb);
internal static extern int indy_get_endpoint_for_did(int command_handle, int wallet_handle, int pool_handle, string did, DidGetEndpointForDidCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_get_endpoint_for_did.
Expand All @@ -154,7 +154,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_set_did_metadata(int command_handle, IntPtr wallet_handle, string did, string metadata, IndyMethodCompletedDelegate cb);
internal static extern int indy_set_did_metadata(int command_handle, int wallet_handle, string did, string metadata, IndyMethodCompletedDelegate cb);

/// <summary>
/// Retrieves the meta information for the giving DID in the wallet.
Expand All @@ -165,7 +165,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_get_did_metadata(int command_handle, IntPtr wallet_handle, string did, DidGetDidMetadataCompletedDelegate cb);
internal static extern int indy_get_did_metadata(int command_handle, int wallet_handle, string did, DidGetDidMetadataCompletedDelegate cb);

/// <summary>
/// Delegate to be used on completion of calls to indy_get_did_metadata.
Expand All @@ -184,7 +184,7 @@ internal static class NativeMethods
/// <param name="my_did">My did.</param>
/// <param name="cb">Cb.</param>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_get_my_did_with_meta(int command_handle, IntPtr wallet_handle, string my_did, GetMyDidWithMetaCompletedDelegate cb);
internal static extern int indy_get_my_did_with_meta(int command_handle, int wallet_handle, string my_did, GetMyDidWithMetaCompletedDelegate cb);

/// <summary>
/// Delegate to be used on comletion of calls to indy_get_my_did_with_meta
Expand All @@ -199,7 +199,7 @@ internal static class NativeMethods
/// <param name="wallet_handle">Wallet handle.</param>
/// <param name="cb">Cb.</param>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_list_my_dids_with_meta(int command_handle, IntPtr wallet_handle, ListMyDidsWithMetaCompletedDelegate cb);
internal static extern int indy_list_my_dids_with_meta(int command_handle, int wallet_handle, ListMyDidsWithMetaCompletedDelegate cb);

/// <summary>
/// Delegate to be used on comletion of calls to indy_list_my_dids_with_meta
Expand Down
6 changes: 4 additions & 2 deletions IndyDotNet/IndyDotNet.csproj
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageVersion>0.1.1</PackageVersion>
<PackageVersion>0.1.2</PackageVersion>
<Authors>matt raffel </Authors>
<DevelopmentDependency>true</DevelopmentDependency>
<PackageLicenseUrl>https://github.com/tatmanblue/IndyDotNet/blob/master/LICENSE-MIT</PackageLicenseUrl>
Expand All @@ -15,6 +15,8 @@ This project provides .NET facade for using IndySDK C callable API.</Summary>
<Title>IndyDotNet</Title>
<Description>.NET wrapper (facade) for hyperledgers IndySDK library. It can be used entirely excluding or inconjuction Hyperledgers indysdk dotnet wrapper.</Description>
<PackageId>IndyDotNet</PackageId>
<Version>1.1.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net45|AnyCPU'">
Expand Down
10 changes: 5 additions & 5 deletions IndyDotNet/Ledger/SDK.cs
Expand Up @@ -32,7 +32,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_sign_and_submit_request(int command_handle, IntPtr pool_handle, IntPtr wallet_handle, string submitter_did, string request_json, SubmitRequestCompletedDelegate cb);
internal static extern int indy_sign_and_submit_request(int command_handle, int pool_handle, int wallet_handle, string submitter_did, string request_json, SubmitRequestCompletedDelegate cb);

/// <summary>
/// Publishes request message to validator pool (no signing, unlike sign_and_submit_request).
Expand All @@ -43,7 +43,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_submit_request(int command_handle, IntPtr pool_handle, string request_json, SubmitRequestCompletedDelegate cb);
internal static extern int indy_submit_request(int command_handle, int pool_handle, string request_json, SubmitRequestCompletedDelegate cb);

/// <summary>
/// Send action to particular nodes of validator pool.
Expand All @@ -60,7 +60,7 @@ internal static class NativeMethods
/// <param name="timeout">Timeout.</param>
/// <param name="cb">Cb.</param>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_submit_action(int command_handle, IntPtr pool_handle, string request_json, string nodes, int timeout, SubmitRequestCompletedDelegate cb);
internal static extern int indy_submit_action(int command_handle, int pool_handle, string request_json, string nodes, int timeout, SubmitRequestCompletedDelegate cb);


/// <summary>
Expand All @@ -73,7 +73,7 @@ internal static class NativeMethods
/// <param name="cb">The function that will be called when the asynchronous call is complete.</param>
/// <returns>0 if the command was initiated successfully. Any non-zero result indicates an error.</returns>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_sign_request(int command_handle, IntPtr wallet_handle, string submitter_did, string request_json, SignRequestCompletedDelegate cb);
internal static extern int indy_sign_request(int command_handle, int wallet_handle, string submitter_did, string request_json, SignRequestCompletedDelegate cb);

/// <summary>
/// Multi signs request message.
Expand All @@ -88,7 +88,7 @@ internal static class NativeMethods
/// <param name="request_json">Request json.</param>
/// <param name="cb">Cb.</param>
[DllImport(Consts.NATIVE_LIB_NAME, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)]
internal static extern int indy_multi_sign_request(int command_handle, IntPtr wallet_handle, string submitter_did, string request_json, SignRequestCompletedDelegate cb);
internal static extern int indy_multi_sign_request(int command_handle, int wallet_handle, string submitter_did, string request_json, SignRequestCompletedDelegate cb);


/// <summary>
Expand Down

0 comments on commit 7cadd31

Please sign in to comment.