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

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

public ProtectAsync ( [ data ) : IAsyncOperation
data [
Результат IAsyncOperation
		public extern IAsyncOperation<IBuffer> ProtectAsync([In] IBuffer data);
		public extern IAsyncOperation<IBuffer> UnprotectAsync([In] IBuffer data);

Usage Example

Пример #1
0
 public async Task<string> EncryptString(string input) {
     if (input == null) return "";
     var provider = new DataProtectionProvider("LOCAL=user");
     var inputBuffer = CryptographicBuffer.ConvertStringToBinary(input, BinaryStringEncoding.Utf8);
     var crypted = await provider.ProtectAsync(inputBuffer);
     return CryptographicBuffer.EncodeToBase64String(crypted);
 }
All Usage Examples Of Windows.Security.Cryptography.DataProtection.DataProtectionProvider::ProtectAsync