public static Task <List <byte> > EncSecretKeyGetAsync(ulong encSecKeyH) { var tcs = new TaskCompletionSource <List <byte> >(); EncSecretKeyGetCb callback = null; callback = (pVoid, result, encSecKeyPtr) => { if (result.ErrorCode != 0) { tcs.SetException(result.ToException()); CallbackManager.Unregister(callback); return; } tcs.SetResult(encSecKeyPtr.ToList <byte>((IntPtr)KeyLen)); CallbackManager.Unregister(callback); }; CallbackManager.Register(callback); NativeBindings.EncSecretKeyGet(Session.AppPtr, encSecKeyH, Session.UserData, callback); return(tcs.Task); }
public static extern void EncSecretKeyGetNative(IntPtr appPtr, ulong encryptSecKeyHandle, IntPtr self, EncSecretKeyGetCb callback);
public void EncSecretKeyGet(IntPtr appPtr, ulong encryptSecKeyHandle, IntPtr self, EncSecretKeyGetCb callback) { EncSecretKeyGetNative(appPtr, encryptSecKeyHandle, self, callback); }