pub enum CredentialSubject {
Basic(CredentialSubjectBasic),
Statement(CredentialSubjectStatement),
Authority(CredentialSubjectAuthority),
Delegation(CredentialSubjectDelegation),
Membership(CredentialSubjectMembership),
}Expand description
This represents all possible credential subjects The order of the enum is important as it will match on first match
Variants§
Basic(CredentialSubjectBasic)
Credential Subject of just id
Used by a community-issued VMC, and by VRC, VIC and VPC
Statement(CredentialSubjectStatement)
Verifiable Statement Credential subject: id, predicate, object.
Unambiguous under the untagged match: no other DTG subject carries a predicate or
an object, and both are REQUIRED here. Unmodelled members are kept rather than
refused, because a verifier MUST ignore members a profile does not define.
Authority(CredentialSubjectAuthority)
Verifiable Authority Credential subject.
Unambiguous under the untagged match: no other DTG subject carries an authority
member, and deny_unknown_fields keeps a subject that does not have one from
landing here.
Delegation(CredentialSubjectDelegation)
Verifiable Delegation Credential subject.
Unambiguous for the same reason as CredentialSubject::Authority: delegation is
carried by no other DTG subject.
Membership(CredentialSubjectMembership)
Membership Credential subject, carrying the digestMultibase that a member-issued
VMC MUST set and a community-issued one MUST omit.
§{ id } lands on Basic first
The grant’s shape is also CredentialSubject::Basic’s, which the untagged match
takes first; only the credential’s type says it is a membership. So
TryFrom<DTGCommon> for DTGCredential re-wraps a Basic subject as this one when
type includes MembershipCredential, and a Membership subject reaching a matcher
has been through that normalization. The acknowledgement’s { id, digestMultibase }
lands here directly.