status

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	StatusRevocation StatusPurpose = "revocation"
	StatusSuspension StatusPurpose = "suspension"

	StatusList2021CreddentialType string = "StatusList2021Credential"
	StatusList2021EntryType       string = "StatusList2021Entry"
	StatusList2021Type            string = "StatusList2021"

	StatusList2021Context string = "https://w3id.org/vc/status-list/2021/v1"

	// KB represents the size of a KB
	KB = 1 << 10
)

Variables

This section is empty.

Functions

func GenerateStatusList2021Credential

func GenerateStatusList2021Credential(id string, issuer string, purpose StatusPurpose, issuedCredentials []credential.VerifiableCredential) (*credential.VerifiableCredential, error)

GenerateStatusList2021Credential generates a status list credential given an ID (the URI where this entity will be hosted), the issuer DID, the purpose of the list, and a set of credentials to include in the list. https://w3c-ccg.github.io/vc-status-list-2021/#generate-algorithm

func ValidateCredentialInStatusList

func ValidateCredentialInStatusList(credentialToValidate credential.VerifiableCredential, statusCredential credential.VerifiableCredential) (bool, error)

ValidateCredentialInStatusList determines whether a credential is contained in a status list 2021 credential https://w3c-ccg.github.io/vc-status-list-2021/#validate-algorithm NOTE: this method does perform credential signature/proof block verification

Types

type StatusList2021Credential

type StatusList2021Credential struct {
	ID            string        `json:"id"  validate:"required"`
	Type          string        `json:"type"  validate:"required"`
	StatusPurpose StatusPurpose `json:"statusPurpose"  validate:"required"`
	EncodedList   string        `json:"encodedList"  validate:"required"`
}

StatusList2021Credential the credential subject value of a status list credential https://w3c-ccg.github.io/vc-status-list-2021/#statuslist2021credential

type StatusList2021Entry

type StatusList2021Entry struct {
	ID                   string        `json:"id" validate:"required"`
	Type                 string        `json:"type" validate:"required"`
	StatusPurpose        StatusPurpose `json:"statusPurpose" validate:"required"`
	StatusListIndex      string        `json:"statusListIndex" validate:"required"`
	StatusListCredential string        `json:"statusListCredential" validate:"required"`
}

StatusList2021Entry the representation within a credential that is associated with a status list https://w3c-ccg.github.io/vc-status-list-2021/#statuslist2021entry

type StatusPurpose

type StatusPurpose string

Jump to

Keyboard shortcuts

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