bitstringstatus

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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

View Source
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

func (v *Validator) MultiBaseEncoding() bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL