vc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCredential

func ValidateCredential(
	ctx context.Context,
	cred interface{},
	formats []vcsverifiable.Format,
	checkExpiration bool,
	enforceStrictValidation bool,
	documentLoader jsonld.DocumentLoader,
	opts ...verifiable.CredentialOpt,
) (*verifiable.Credential, error)

Types

type SDJWT

type SDJWT struct {
	Enable  bool        `json:"enable,omitempty"`
	HashAlg crypto.Hash `json:"hashAlg,omitempty"`
}

SDJWT represents the SD-JWT configuration.

type Signer

type Signer struct {
	DID                     string
	Creator                 string
	KMSKeyID                string
	SignatureType           vcsverifiable.SignatureType
	KeyType                 kms.KeyType
	Format                  vcsverifiable.Format               // VC format - LDP/JWT.
	SignatureRepresentation verifiable.SignatureRepresentation // For LDP only - proof/JWS.
	KMS                     keyManager
	VCStatusListType        StatusType // Type of VC status list
	SDJWT                   SDJWT
}

Signer contains information about vc signer, usually this is credential issuer.

type SignerAlgorithm

type SignerAlgorithm interface {
	Sign(data []byte) ([]byte, error)
	Alg() string
}

type StatusProcessor

type StatusProcessor interface {
	ValidateStatus(vcStatus *verifiable.TypedID) error
	GetStatusVCURI(vcStatus *verifiable.TypedID) (string, error)
	GetStatusListIndex(vcStatus *verifiable.TypedID) (int, error)
	CreateVC(vcID string, listSize int, profile *Signer) (*verifiable.Credential, error)
	CreateVCStatus(statusListIndex string, vcID string) *verifiable.TypedID
	GetVCContext() string
}

StatusProcessor holds the list of methods required for processing different versions of Status(Revocation) List VC.

type StatusProcessorGetter

type StatusProcessorGetter func(vcStatusListType StatusType) (StatusProcessor, error)

type StatusType

type StatusType string

StatusType is used to define implementation of VC status list. Field verifiable.TypedID .Type.

const (
	// StatusList2021VCStatus represents the implementation of VC Status List 2021.
	//  VC > Status > Type
	// 	Doc: https://w3c-ccg.github.io/vc-status-list-2021/
	StatusList2021VCStatus StatusType = "StatusList2021Entry"

	// RevocationList2021VCStatus represents the implementation of VC Status List 2021 v.0.0.1.
	//  VC > Status > Type
	//  Doc: https://github.com/w3c-ccg/vc-status-list-2021/releases/tag/v0.0.1
	RevocationList2021VCStatus StatusType = "RevocationList2021Status"

	// RevocationList2020VCStatus represents the implementation of VC Revocation List 2020.
	//  VC > Status > Type
	// 	Doc: https://w3c-ccg.github.io/vc-status-rl-2020/
	RevocationList2020VCStatus StatusType = "RevocationList2020Status"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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