Table of Contents

Class PermitKeyProvider

Namespace
EncDotNet.S100.ExchangeSets.Protection
Assembly
EncDotNet.S100.ExchangeSets.dll

An IDatasetKeyProvider backed by a parsed PermitFile and a Data Client hardware id. It locates the permit for a requested dataset and unwraps its cell key with the hardware id.

public sealed class PermitKeyProvider : IDatasetKeyProvider
Inheritance
PermitKeyProvider
Implements
Inherited Members

Remarks

S-100 Edition 5.2.1 Part 15 §15-7. The hardware id is the Data Client system identifier that data permits are bound to; the same key decrypts a base dataset and all of its incremental updates (§15-6.2).

Constructors

PermitKeyProvider(PermitFile, HardwareId, ExchangeCatalogue, string?)

Creates a key provider over a permit file and hardware id.

public PermitKeyProvider(PermitFile permitFile, HardwareId hardwareId, ExchangeCatalogue catalogue, string? productId = null)

Parameters

permitFile PermitFile

The parsed permit file.

hardwareId HardwareId

The Data Client system hardware id.

catalogue ExchangeCatalogue

The exchange catalogue whose edition and issue metadata constrain the permits.

productId string

An optional product specification id (e.g. S-101) to restrict permit lookups to a single product section.

Methods

Evaluate(string)

Evaluates the permit that applies to a catalogue dataset.

public PermitEvaluationResult Evaluate(string datasetFileName)

Parameters

datasetFileName string

The dataset file name, with or without a path.

Returns

PermitEvaluationResult

The structured permit-policy outcome.

TryGetCellKey(string, out byte[]?)

Attempts to resolve the 16-byte cell key for the dataset with the given file name.

public bool TryGetCellKey(string datasetFileName, out byte[]? cellKey)

Parameters

datasetFileName string

The dataset file name (with or without extension) as it appears in the exchange set.

cellKey byte[]

The resolved 16-byte cell key, if available.

Returns

bool

true if a key was resolved.

Exceptions

DatasetPermitException

A matching protected dataset is rejected by its permit policy.