Class AesDataSink

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

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

Inheritance
System.Object
AesDataSink
Implements
Namespace: Catalog.Helpers
Assembly: Catalog.dll
Syntax
public class AesDataSink : IDataSink

Properties

DataSinkOption

Declaration
public DataSinkOption DataSinkOption { get; }
Property Value
Type Description
DataSinkOption

Methods

CreateAesDataSinkAsync(Byte[], IRandomAccessStream, Boolean)

Creates the data sink and sets the position of the stream to the first byte after the header.

Declaration
public static async Task<AesDataSink> CreateAesDataSinkAsync(byte[] key, IRandomAccessStream stream, bool newStream)
Parameters
Type Name Description
System.Byte[] key

The AES key.

Windows.Storage.Streams.IRandomAccessStream stream

The stream to write to.

System.Boolean newStream

If this is a new stream set it to true and it will truncate and initialise the stream with a header. If set to false then the existing header is read.

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

Finish()

Declaration
public bool Finish()
Returns
Type Description
System.Boolean

WriteDataAsync(IBuffer)

Declaration
public IAsyncOperation<bool> WriteDataAsync(IBuffer data)
Parameters
Type Name Description
Windows.Storage.Streams.IBuffer data
Returns
Type Description
Windows.Foundation.IAsyncOperation<System.Boolean>

Implements

IDataSink