Windows.Security.Cryptography.DataProtection.DataProtectionProvider.UnprotectAsync C# (CSharp) Метод

UnprotectAsync() публичный Метод

public UnprotectAsync ( [ data ) : IAsyncOperation
data [
Результат IAsyncOperation
		public extern IAsyncOperation<IBuffer> UnprotectAsync([In] IBuffer data);
		public extern IAsyncAction ProtectStreamAsync([In] IInputStream src, [In] IOutputStream dest);

Usage Example

        /// <summary>
        /// Retrieves the specified key.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <returns>System.Byte[].</returns>
        /// <exception cref="System.Exception"></exception>
        public byte[] Retrieve(string key)
        {
            var mutex = new Mutex(false, key);

            try
            {
                mutex.WaitOne();

                var file = AppStorage.LocalFolder.GetFileAsync(key);

                var bufferTask = FileIO.ReadBufferAsync(file.GetResults());

                var buffer = bufferTask.GetResults();

                if (_optionalEntropy != null)
                {
                    buffer = _dataProtectionProvider.UnprotectAsync(buffer).GetResults();
                }

                return(buffer.ToArray());
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("No entry found for key {0}.", key), ex);
            }
            finally
            {
                mutex.ReleaseMutex();
            }
        }
All Usage Examples Of Windows.Security.Cryptography.DataProtection.DataProtectionProvider::UnprotectAsync