services

package
v0.0.0-...-5ce25cb Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJSONLDURLNotFound = errors.New("jsonLdContext not found in schema metadata")

Functions

func BuildCoreClaim

func BuildCoreClaim(
	schemaSuite jsonSuite.Schema,
	schemaBytes []byte,
	vc verifiable.W3CCredential,
	credentialReq CredentialRequest,
	revocationNonce uint64,
	version uint32,
) (*core.Claim, error)

func CreateW3CCredential

func CreateW3CCredential(
	schema jsonSuite.Schema,
	issuer string,
	req CredentialRequest,
	chainID int,
) (verifiable.W3CCredential, error)

func RandInt64

func RandInt64() (uint64, error)

func StateVerificationHandler

func StateVerificationHandler(
	ethStateContracts map[string]*abi.State,
) packers.VerificationHandlerFunc

Types

type CredentialRequest

type CredentialRequest struct {
	CredentialSchema      string          `json:"credentialSchema"`
	Type                  string          `json:"type"`
	CredentialSubject     json.RawMessage `json:"credentialSubject"`
	Expiration            int64           `json:"expiration,omitempty"`
	Version               uint32          `json:"version,omitempty"`
	RevNonce              *uint64         `json:"revNonce,omitempty"`
	SubjectPosition       string          `json:"subjectPosition,omitempty"`
	MerklizedRootPosition string          `json:"merklizedRootPosition,omitempty"`
}

type OnChain

type OnChain struct {
	CredentialRepository *repository.CredentialRepository
}

func (*OnChain) CreateClaimOnChain

func (oc *OnChain) CreateClaimOnChain(
	ctx context.Context,
	issuer string,
	credentialReq CredentialRequest,
) (string, error)

CreateClaimOnChain create onchain vc to issuer

func (*OnChain) GetUserVCByID

func (oc *OnChain) GetUserVCByID(
	ctx context.Context,
	issuer string,
	credentialID string,
) (verifiable.W3CCredential, error)

func (*OnChain) GetUsersVCs

func (oc *OnChain) GetUsersVCs(
	ctx context.Context,
	issuer string,
	subject string,
	schemaType string,
) ([]verifiable.W3CCredential, error)

func (*OnChain) IsRevokedVC

func (oc *OnChain) IsRevokedVC(
	ctx context.Context,
	issuer string,
	nonce uint64,
) (bool, error)

func (*OnChain) RevokeVC

func (oc *OnChain) RevokeVC(
	ctx context.Context,
	issuer string,
	nonce uint64,
) error

Jump to

Keyboard shortcuts

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