Class S57ExchangeSetVerification
Adapts the upstream EncDotNet.S57 exchange-set verifier (S-57 / S-63
CATALOG.031 CRC + digital-signature checks) onto this repository's
S-100 ExchangeSetVerificationResult model, so S-57 exchange
sets are integrity-verified and surfaced exactly like S-100 ones.
public static class S57ExchangeSetVerification
- Inheritance
-
S57ExchangeSetVerification
- Inherited Members
Remarks
This is a deliberately thin adapter rather than a shared interface:
the S-57 verifier is rooted at a directory path (CATALOG.031 + the
files it references), whereas the S-100 verifier is
IAssetSource-based. Forcing both behind one
interface would distort both, so the two verifiers stay independent and this
type only maps the result.
The mapping is safe because the two outcome enumerations are kept
byte-identical (same names, same ordinals); the mapping is nonetheless done
by name so a future divergence fails loudly rather than silently
mis-mapping. S-57 integrity uses a CRC-32 (CATALOG.031 field), not the
SHA-256 digest the S-100 model carries, so the per-file CRC values are
surfaced through Detail and
ComputedSha256 is left
null.
Methods
Map(S57ExchangeSetVerificationResult)
Maps an S57ExchangeSetVerificationResult onto the S-100 ExchangeSetVerificationResult model. Exposed (rather than private) so it can be unit-tested directly against synthetic S-57 results.
public static ExchangeSetVerificationResult Map(S57ExchangeSetVerificationResult result)
Parameters
resultS57ExchangeSetVerificationResultThe S-57 verification result to map.
Returns
- ExchangeSetVerificationResult
The equivalent S-100 result.
Exceptions
- ArgumentNullException
resultis null.
MapFile(S57FileVerificationResult)
Maps a single S57FileVerificationResult onto the S-100 FileVerificationResult, preserving both the signature and checksum dimensions independently.
public static FileVerificationResult MapFile(S57FileVerificationResult file)
Parameters
fileS57FileVerificationResultThe S-57 per-file result.
Returns
- FileVerificationResult
The equivalent S-100 per-file result.
MapOutcome(S57VerificationOutcome)
Maps an S57VerificationOutcome onto the S-100 VerificationOutcome by name. The two enumerations are kept byte-identical so the cross-repo bridge can drive both uniformly.
public static VerificationOutcome MapOutcome(S57VerificationOutcome outcome)
Parameters
outcomeS57VerificationOutcomeThe S-57 outcome.
Returns
- VerificationOutcome
The equivalent S-100 outcome.
Exceptions
- ArgumentOutOfRangeException
The S-57 outcome has no S-100 counterpart (indicates the two enumerations have diverged).
VerifyAsync(string, bool, CancellationToken)
Verifies the S-57 exchange set rooted at rootPath
(the directory containing its CATALOG.031) and returns the result
mapped onto the S-100 ExchangeSetVerificationResult model.
public static Task<ExchangeSetVerificationResult> VerifyAsync(string rootPath, bool allowUntrustedCertificates = true, CancellationToken cancellationToken = default)
Parameters
rootPathstringThe exchange-set root directory (the folder that contains
CATALOG.031).allowUntrustedCertificatesboolWhen true (the default), signature checks do not fail solely because the signing certificate chains to an untrusted root — mirrors the S-100 verifier's AllowUntrustedCertificates.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<ExchangeSetVerificationResult>
The verification result in the S-100 result model.
Exceptions
- ArgumentException
rootPathis null or empty.