SAIF.NetCore.SystemHash overview¶
Documentation context: NuGet package (pipeline-packed), consumed as
SAIF.NetCore.SystemHashby application startup code and bySAIF.NetCore.EnvironmentClientandSAIF.NetCore.OIDCthrough theISystemHashServiceinterface only.
SAIF.NetCore.SystemHash is a single-class implementation-layer library that produces and validates a system-hash caller-identity credential: a SHA-256/Base64 digest of an application's assembly name and a SystemType classification, salted with a timestamp by SAIF.NetCore.HashUtil's SaltShaker. Consumers present the salted credential to the external Environment API to retrieve secure settings or crypto configuration; this library also implements the server-side lifetime check that rejects an expired credential. It targets net8.0 and net10.0.
Purpose¶
- Issue a time-stamped, salted identity credential (
ComputeHash,Get) that a calling application attaches to secure-setting requests. - Compute the deterministic, unsalted identity hash (
ComputeHashNow) that a validating service can compare a de-salted credential against. - De-salt a previously issued credential and enforce its lifetime window (
RemoveSystemHashSaltAndValidateLifetime), throwingSystemHashExpiredException(fromSAIF.NetCore.HashUtil) when the credential is expired or not yet valid.
Responsibilities¶
- Implement
ISystemHashService(SAIF.NetCore.ServiceContracts) as the repository's sole concreteSystemHashService. - Resolve the "system name" used in the identity hash from either an explicitly supplied
Assembly(constructor) orAssembly.GetCallingAssembly(). - Delegate the reversible salt/de-salt mechanics to
SAIF.NetCore.HashUtil'sSaltShaker, while owning the create-timestamp selection and the lifetime decision itself.
Key components¶
SystemHashService: the library's only public type; implements all fiveISystemHashServicemembers and the privateGetHashValueSHA-256 helper.
Related documentation¶
- Index
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Security and authorization
- API reference
Sources¶
src/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash.csprojsrc/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SAIF.NetCore.SystemHash/SystemHashService.cssrc/SAIF.NetCore.SystemHash/README.md