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 ¶
func AuthZSubject(vc json.Marshaler) (*AuthorizationCredentialSubject, error)
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.
Click to show internal directories.
Click to hide internal directories.