vc

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// VerifiableCredential vc type.
	VerifiableCredential = "VerifiableCredential"

	// VerifiableCredentialContext vc base context.
	VerifiableCredentialContext = "https://www.w3.org/2018/credentials/v1"

	// AssuranceCredentialContext is the JSON-LD context for the AssuranceCredential.
	AssuranceCredentialContext = "https://trustbloc.github.io/context/vc/assurance-credential-v1.jsonld"

	// AssuranceCredentialType is the JSON-LD type for the AssuranceCredential.
	AssuranceCredentialType = "AssuranceCredential"
)
View Source
const (
	// AuthorizationCredentialContext is the JSON-LD context for the AuthorizationCredential.
	AuthorizationCredentialContext = "https://trustbloc.github.io/context/vc/authorization-credential-v1.jsonld"
	// AuthorizationCredentialType is the JSON-LD type for the AuthorizationCredential.
	AuthorizationCredentialType = "AuthorizationCredential"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationCredential

type AuthorizationCredential struct {
	Subject *AuthorizationCredentialSubject `json:"credentialSubject"`
}

AuthorizationCredential is a VC that contains the issuer/rp/user did docs.

type AuthorizationCredentialSubject

type AuthorizationCredentialSubject struct {
	ID            string                      `json:"id,omitempty"`
	Scope         []*presexch.InputDescriptor `json:"scope"`
	IssuerDIDDoc  *DIDDoc                     `json:"issuerDIDDoc,omitempty"`
	RPDIDDoc      *DIDDoc                     `json:"requestingPartyDIDDoc,omitempty"`
	SubjectDIDDoc *DIDDoc                     `json:"subjectDIDDoc,omitempty"`
}

AuthorizationCredentialSubject struct for sending the issuer IssuerDIDDoc to wallet.

func AuthZSubject

AuthZSubject returns the AuthorizationCredentialSubject from the verifiable credential.

type Crypto

type Crypto interface {
	SignCredential(*verifiable.Credential, string) (*verifiable.Credential, error)

	SignPresentation(*verifiable.Presentation, string) (*verifiable.Presentation, error)
}

Crypto vc/vp signing apis.

type DIDDoc

type DIDDoc struct {
	ID  string          `json:"id,omitempty"`
	Doc json.RawMessage `json:"doc,omitempty"`
}

DIDDoc is how a DID document is transported over the wire. The ID is separate from the contents because of the self-certifying properties of some DID methods (eg. did:peer and did:key) where the ID is derived from the rest of the contents of the document.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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