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 ¶
GetPublicKey fetches the key from the Registry URL. It assumes the URL returns a single JWK for now (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 ¶
GetPublicKey reads the key from the local file. It ignores the issuer argument for the MVP (trusts the local key for all).
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.