Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public static extern void EncSecretKeyGetNative(IntPtr appPtr, ulong encryptSecKeyHandle, IntPtr self, EncSecretKeyGetCb callback);
Esempio n. 3
0
 public void EncSecretKeyGet(IntPtr appPtr, ulong encryptSecKeyHandle, IntPtr self, EncSecretKeyGetCb callback)
 {
     EncSecretKeyGetNative(appPtr, encryptSecKeyHandle, self, callback);
 }