Table of Contents

Class S100ExchangeSetProtectionExtensions

Namespace
EncDotNet.S100
Assembly
EncDotNet.S100.dll

S-100 Part 15 data protection for S100ExchangeSet: reading an exchange set whose datasets are encrypted.

public static class S100ExchangeSetProtectionExtensions
Inheritance
S100ExchangeSetProtectionExtensions
Inherited Members

Methods

WithDecryption(S100ExchangeSet, IDatasetKeyProvider)

Returns a view of exchangeSet whose datasets are decrypted with the cell keys from keys as they are read (S-100 Part 15 §15-5, §15-6).

public static S100ExchangeSet WithDecryption(this S100ExchangeSet exchangeSet, IDatasetKeyProvider keys)

Parameters

exchangeSet S100ExchangeSet

The exchange set whose datasets are encrypted.

keys IDatasetKeyProvider

Resolves the cell key for each protected dataset.

Returns

S100ExchangeSet

An exchange set over the same catalogue that reads plaintext.

Remarks

Part 15 cell keys depend on the catalogue (the permit is checked against each dataset's edition and issue date), so open the exchange set first, build the key provider from its Catalogue — typically a PermitKeyProvider over a permit authenticated with AuthenticateAsync(Stream, Stream?, string, TrustAnchorOptions, CancellationToken) — and then call this method.

Files for which keys has no cell key (the catalogue, unencrypted support files) are read unchanged. Decrypted datasets are also decompressed when the catalogue declares compressionFlag for any dataset (§15-5.2). Opening a protected dataset that its permit does not authorize throws DatasetPermitException. Reading a protected dataset that its permit authorizes but whose unwrapped cell key cannot decrypt it (most often a wrong hardware id) throws DatasetDecryptionException.

The returned exchange set reads through exchangeSet's source without taking ownership of it: keep exchangeSet alive while the returned set, or any dataset opened from it, is in use.

Exceptions

ArgumentNullException

exchangeSet or keys is null.

ObjectDisposedException

exchangeSet has been disposed.