registry

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package registry implements the Trust Registry interface for key retrieval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudRegistry

type CloudRegistry struct {
	RegistryURL string
	Client      *http.Client
	// contains filtered or unexported fields
}

CloudRegistry implements Registry by fetching keys from a URL.

func NewCloudRegistry

func NewCloudRegistry(url string) *CloudRegistry

NewCloudRegistry creates a new CloudRegistry.

func (*CloudRegistry) GetPublicKey

func (r *CloudRegistry) GetPublicKey(ctx context.Context, issuer string) (crypto.PublicKey, error)

GetPublicKey fetches the key from the Registry URL. It assumes the URL returns a single JWK for now (MVP).

func (*CloudRegistry) IsRevoked

func (r *CloudRegistry) IsRevoked(_ context.Context, _ string) (bool, error)

IsRevoked checks revocation (not implemented for MVP).

type LocalRegistry

type LocalRegistry struct {
	KeyPath string
	// contains filtered or unexported fields
}

LocalRegistry implements Registry using a local file.

func NewLocalRegistry

func NewLocalRegistry(path string) *LocalRegistry

NewLocalRegistry creates a new LocalRegistry.

func (*LocalRegistry) GetPublicKey

func (r *LocalRegistry) GetPublicKey(_ context.Context, _ string) (crypto.PublicKey, error)

GetPublicKey reads the key from the local file. It ignores the issuer argument for the MVP (trusts the local key for all).

func (*LocalRegistry) IsRevoked

func (r *LocalRegistry) IsRevoked(_ context.Context, _ string) (bool, error)

IsRevoked checks if the ID is in the local blocklist (not implemented yet).

type Registry

type Registry interface {
	// GetPublicKey fetches the public key for a given Issuer DID/URI.
	// Returns the public key and any error encountered.
	GetPublicKey(ctx context.Context, issuerDID string) (crypto.PublicKey, error)

	// IsRevoked checks if a specific Badge ID (or Subject) has been revoked.
	IsRevoked(ctx context.Context, badgeID string) (bool, error)
}

Registry defines the interface for the CapiscIO Trust Registry. It is responsible for resolving trusted public keys for Issuers.

Jump to

Keyboard shortcuts

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