Class ExchangeSetVerifier
- Namespace
- EncDotNet.S100.ExchangeSets
- Assembly
- EncDotNet.S100.ExchangeSets.dll
Verifies the per-file digital signatures in an S-100 exchange set.
public class ExchangeSetVerifier : IExchangeSetVerifier
- Inheritance
-
ExchangeSetVerifier
- Implements
- Inherited Members
Remarks
S-100 Edition 5.2.1 Part 15. Signatures are computed over the representation
selected by their data status, or over another signature's ASN.1 bytes, and
verified against the certificate identified by
CertificateRef. File-based Part 15
signatures use ECDSA P-384 with SHA-384 (§15-8.4); legacy algorithms retain
their existing compatibility behavior. Each file is also independently
integrity-checked with SHA-256 when the catalogue declares a cryptographic
hash (§15-8.10). The catalogue itself is checked against CATALOG.SIGN
when the exchange set has one (§15-8.11.2).
Constructors
ExchangeSetVerifier()
Creates a verifier that can resolve unprotected and stored encrypted signature content.
public ExchangeSetVerifier()
ExchangeSetVerifier(ISignatureContentResolver)
Creates a verifier with a custom signed-content resolver.
public ExchangeSetVerifier(ISignatureContentResolver contentResolver)
Parameters
contentResolverISignatureContentResolverThe resolver used to open the representation selected by a signature's
dataStatus.
Methods
OpenContentForHashingAsync(IAssetSource, string, DigitalSignatureValue?, CancellationToken)
Opens the file content that should be hashed for verification.
protected virtual Task<Stream> OpenContentForHashingAsync(IAssetSource source, string normalizedPath, DigitalSignatureValue? signatureValue, CancellationToken cancellationToken)
Parameters
sourceIAssetSourceThe asset source containing the file.
normalizedPathstringThe normalized, source-relative file path.
signatureValueDigitalSignatureValueThe file's signature value, if any.
cancellationTokenCancellationTokenA cancellation token.
Returns
Remarks
The default implementation returns the bytes exposed by the asset
source. This compatibility seam is used for checksum calculation and
legacy signatures. Part 15 SignatureOnData forms are resolved
through the injected ISignatureContentResolver according
to their explicit dataStatus.
VerifyAsync(IAssetSource, ExchangeCatalogue, TrustAnchorOptions, CancellationToken)
Verifies the per-file digital signatures declared in catalogue
against the files accessible through source.
public Task<ExchangeSetVerificationResult> VerifyAsync(IAssetSource source, ExchangeCatalogue catalogue, TrustAnchorOptions trustAnchors, CancellationToken cancellationToken = default)
Parameters
sourceIAssetSourceThe asset source containing the exchange set files.
catalogueExchangeCatalogueThe parsed exchange catalogue whose signatures to verify.
trustAnchorsTrustAnchorOptionsTrust anchor options controlling certificate chain validation.
cancellationTokenCancellationTokenA cancellation token.
Returns
- Task<ExchangeSetVerificationResult>
A result enumerating per-file verification outcomes without throwing.