vc

package
v1.0.0-beta.rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

package vc contains an implementation of the W3 Verifiable Credentials data model. https://www.w3.org/TR/verifiable-claims-data-model

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proof

type Proof struct {
	Type       string     `json:"type,omitempty"`
	Created    *time.Time `json:"created,omitempty"`
	Creator    string     `json:"creator,omitempty"`
	ProofValue string     `json:"proofValue,omitempty"`
}

Proof represents a proof for a verifiable credential or presentation.

https://www.w3.org/TR/verifiable-claims-data-model/#proofs-signatures

type VerifiableCredential

type VerifiableCredential struct {
	Context           []string               `json:"@context,omitempty"`
	ID                string                 `json:"id,omitempty"`
	Type              []string               `json:"type,omitempty"`
	Issuer            string                 `json:"issuer,omitempty"`
	IssuanceDate      *time.Time             `json:"issuanceDate,omitempty"`
	CredentialSubject map[string]interface{} `json:"credentialSubject,omitempty"`
	Proof             *Proof                 `json:"proof,omitempty"`
}

VerifiableCredential represents one or more claims made by the same entity.

https://www.w3.org/TR/verifiable-claims-data-model/#credentials

func NewVerifiableCredential

func NewVerifiableCredential() *VerifiableCredential

NewVerifiableCredential returns a new instance of VerifiableCredential with the default context and type assigned.

type VerifiablePresentation

type VerifiablePresentation struct {
	Context              []string                `json:"@context,omitempty"`
	ID                   string                  `json:"id,omitempty"`
	Type                 []string                `json:"type,omitempty"`
	VerifiableCredential []*VerifiableCredential `json:"verifiableCredential,omitempty"`
	Proof                *Proof                  `json:"proof,omitempty"`
}

VerifiablePresentation combines one or more credentials.

https://www.w3.org/TR/verifiable-claims-data-model/#presentations

func NewVerifiablePresentation

func NewVerifiablePresentation() *VerifiablePresentation

NewVerifiablePresentation returns a new instance of VerifiablePresentation with the default context and type assigned.

Jump to

Keyboard shortcuts

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