pkg

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExampleUniversityVC

func BuildExampleUniversityVC(signer jwx.Signer, universityDID, recipientDID string) (credID string, cred string, err error)

BuildExampleUniversityVC Makes a Verifiable Credential using the VC data type directly. Alternatively, use the builder. A VC is set of tamper-evident claims and metadata that cryptographically proves who issued it. Building a VC means using the CredentialBuilder as part of the credentials package in the ssk-sdk. VerifiableCredential is the verifiable credential model outlined in the vc-data-model spec: https://www.w3.org/TR/2021/REC-vc-data-model-20211109/#basic-concept

func BuildPresentationSubmission

func BuildPresentationSubmission(presentationRequestJWT string, verifier jwx.Verifier, signer jwx.Signer, vc string) ([]byte, error)

BuildPresentationSubmission builds a submission using... https://github.com/extrimian/ssi-sdk/blob/d279ca2779361091a70b8aa3c685a388067409a9/credential/exchange/submission.go#L126

func MakePresentationData

func MakePresentationData(id, inputID, trustedIssuer string) (exchange.PresentationDefinition, error)

MakePresentationData Makes a dummy presentation definition. These are eventually transported via Presentation Request. For more information on presentation definitions view the spec here: https://identity.foundation/presentation-exchange/#term:presentation-definition

func MakePresentationRequest

func MakePresentationRequest(key gocrypto.PrivateKey, keyID string, presentationData exchange.PresentationDefinition, requesterID, audienceID string) (pr []byte, signer *jwx.Signer, err error)

MakePresentationRequest Builds a presentation request (PR). A PR is sent by a holder to a verifier. It can be sent over multiple mechanisms. For more information, please go to here: https://identity.foundation/presentation-exchange/#presentation-request and for the source code with the sdk, https://github.com/extrimian/ssi-sdk/blob/main/credential/exchange/request.go is appropriate to start off with.

func ValidateAccess

func ValidateAccess(verifier jwx.Verifier, r resolution.Resolver, submissionBytes []byte) error

ValidateAccess is a very simple validation process against a Presentation Submission It checks: 1. That the VP is valid 2. All VCs in the VP are valid 3. That the VC was issued by a trusted entity (implied by the presentation, according to the Presentation Definition)

Types

type Entity

type Entity struct {
	Name string
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(name string, didMethod did.Method) (*Entity, error)

func (*Entity) GetWallet

func (e *Entity) GetWallet() *example.SimpleWallet

Jump to

Keyboard shortcuts

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