Documentation
¶
Overview ¶
Package bitstringstatus handles client-side validation and parsing for Credential Status fields of type BitstringStatusList, as per spec: https://www.w3.org/TR/vc-bitstring-status-list/
Index ¶
- Constants
- type Validator
- func (v *Validator) GetStatusListIndex(vcStatus *verifiable.TypedID) (int, error)
- func (v *Validator) GetStatusPurpose(vcStatus *verifiable.TypedID) (string, error)
- func (v *Validator) GetStatusVCURI(vcStatus *verifiable.TypedID) (string, error)
- func (v *Validator) MultiBaseEncoding() bool
- func (v *Validator) ValidateStatus(vcStatus *verifiable.TypedID) error
Constants ¶
const ( // BitstringStatusListType represents the implementation of Bitstring Status List. // VC.Status.Type // Doc: https://www.w3.org/TR/vc-bitstring-status-list/#bitstringstatuslistentry BitstringStatusListType = "BitstringStatusListEntry" // StatusListCredential stores the link to the status list VC. // VC.Status.CustomFields key. StatusListCredential = "statusListCredential" // StatusListIndex identifies the bit position of the status value of the VC. // VC.Status.CustomFields key. StatusListIndex = "statusListIndex" // StatusPurpose for BitstringStatusList. // VC.Status.CustomFields key. Only "revocation" value is supported. // TODO: check if it's really only 'revocation'. Spec allows: refresh, revocation, suspension, message. StatusPurpose = "statusPurpose" // StatusSize indicates the size of the status entry in bits. StatusSize = "statusSize" // StatusMessage represents custom descriptive messages about the status of the verifiable credential. StatusMessage = "statusMessage" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator struct{}
Validator validates a Verifiable Credential's Status field against the BitstringStatusList specification, and returns fields for status verification.
Implements spec: https://www.w3.org/TR/vc-bitstring-status-list/#bitstringstatuslistentry
func (*Validator) GetStatusListIndex ¶
func (v *Validator) GetStatusListIndex(vcStatus *verifiable.TypedID) (int, error)
GetStatusListIndex returns the bit position of the status value of the VC.
func (*Validator) GetStatusPurpose ¶
func (v *Validator) GetStatusPurpose(vcStatus *verifiable.TypedID) (string, error)
GetStatusPurpose returns the purpose of the status list. For example, "revocation", "suspension".
func (*Validator) GetStatusVCURI ¶
func (v *Validator) GetStatusVCURI(vcStatus *verifiable.TypedID) (string, error)
GetStatusVCURI returns the ID (URL) of status VC.
func (*Validator) MultiBaseEncoding ¶
MultiBaseEncoding indicates that status uses MultiBase encoding. See https://www.w3.org/TR/cid-1.0/#multibase-0 for more details.
func (*Validator) ValidateStatus ¶
func (v *Validator) ValidateStatus(vcStatus *verifiable.TypedID) error
ValidateStatus validates that a Verifiable Credential's Status field matches the BitstringStatusList specification.