Class VerificationResult
- Namespace
- Tessio.Verifier.Core
- Assembly
- Tessio.Verifier.Core.dll
Outcome of credential verification. Carries the disclosed claims, issuer info, and any failure reasons.
public sealed record VerificationResult : IEquatable<VerificationResult>
- Inheritance
-
VerificationResult
- Implements
- Inherited Members
Remarks
FROZEN contract (contracts-v0). Forward-compatible: new optional inputs may be added as init-only properties, which is how CredentialType arrived. No existing member changes.
Properties
CredentialType
The credential type that was actually presented: the vct for SD-JWT VC, the
docType for mdoc. Null when verification failed before the type could be read.
public string? CredentialType { get; init; }
Property Value
Remarks
What was PRESENTED, not what was requested. The caller already knows what it asked for. Once a request names several types, which one arrived is a fact only the verifier holds, and without this the only way to learn it is to read a mismatch message, which exists only when the type was wrong. A caller recording what a holder presented, or choosing which claim path to read an answer from, needs it on the passing path too.
Null means "not established", never "the credential declared none". A signature that fails before the payload is parsed leaves nothing to report, and an empty string there would be the stronger and false claim.
Init-only and optional, so every existing construction of this record still compiles and behaves as it did. Additive in the sense the frozen contract permits: no existing member changes.
DisclosedClaims
The claims the holder elected to disclose, keyed by claim name. Empty when IsValid is false. Values are dynamic JSON values represented as object (string, number, bool, list, dict, or null).
public required IReadOnlyDictionary<string, object> DisclosedClaims { get; init; }
Property Value
Errors
Verification failures; empty when IsValid is true.
public required IReadOnlyList<VerificationError> Errors { get; init; }
Property Value
IsValid
True when signature, disclosures, key binding, and trust checks all pass.
public required bool IsValid { get; init; }
Property Value
Issuer
Information about the credential issuer and how its key was resolved.
public required IssuerInfo Issuer { get; init; }
Property Value
Methods
Invalid(IReadOnlyList<VerificationError>, IssuerInfo?)
A failing result carrying every accumulated error and, optionally, the resolved issuer. Falls back to Unknown when no issuer was reached.
public static VerificationResult Invalid(IReadOnlyList<VerificationError> errors, IssuerInfo? issuer = null)
Parameters
errorsIReadOnlyList<VerificationError>issuerIssuerInfo
Returns
Invalid(VerificationError, IssuerInfo?)
A failing result carrying one error and, optionally, the issuer that was resolved.
public static VerificationResult Invalid(VerificationError error, IssuerInfo? issuer = null)
Parameters
errorVerificationErrorissuerIssuerInfo
Returns
Valid(IReadOnlyDictionary<string, object>, IssuerInfo)
A passing result carrying the disclosed claims and resolved issuer. Convenience for tests and self-driving hosts that synthesize results rather than fully initializing every required member.
public static VerificationResult Valid(IReadOnlyDictionary<string, object> disclosedClaims, IssuerInfo issuer)
Parameters
disclosedClaimsIReadOnlyDictionary<string, object>issuerIssuerInfo