Class AesDataProvider

This is an example implementation of a IDataProvider that uses AES encryption.

WARNING! THIS IS NOT PRODUCTION QUALITY CRYPTOGRAPHIC CODE AND IS ONLY PROVIDED AS A LEARNING TOOL!

Inheritance
System.Object
AesDataProvider
Implements
Namespace: Catalog.Helpers
Assembly: Catalog.dll
Syntax
public class AesDataProvider : IDataProvider

Properties

Size

Declaration
public ulong Size { get; }
Property Value
Type Description
System.UInt64

SupportsWriting

Declaration
public bool SupportsWriting { get; }
Property Value
Type Description
System.Boolean

Uid

Declaration
public string Uid { get; }
Property Value
Type Description
System.String

Methods

CreateAESDataProviderAsync(Byte[], IRandomAccessStream)

Create the data sink.

Declaration
public static async Task<AesDataProvider> CreateAESDataProviderAsync(byte[] key, IRandomAccessStream stream)
Parameters
Type Name Description
System.Byte[] key

The key for encrypting the data.

Windows.Storage.Streams.IRandomAccessStream stream

The stream to read from.

Returns
Type Description
System.Threading.Tasks.Task<AesDataProvider>

CreateDataSink(DataSinkOption)

Declaration
public IDataSink CreateDataSink(DataSinkOption option)
Parameters
Type Name Description
DataSinkOption option
Returns
Type Description
IDataSink

ReadAsync(UInt32, UInt32)

Declaration
public IAsyncOperation<IBuffer> ReadAsync(uint size, uint offset)
Parameters
Type Name Description
System.UInt32 size
System.UInt32 offset
Returns
Type Description
Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IBuffer>

ReplaceWithDataSinkAsync(IDataSink)

Declaration
public IAsyncOperation<bool> ReplaceWithDataSinkAsync(IDataSink dataSink)
Parameters
Type Name Description
IDataSink dataSink
Returns
Type Description
Windows.Foundation.IAsyncOperation<System.Boolean>

Implements

IDataProvider