auth

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentIDHash

func AgentIDHash(agentID string) string

AgentIDHash returns the sha256 hex of agentID (for anonymization).

func ResolveDIDKey

func ResolveDIDKey(did string) (ed25519.PublicKey, error)

ResolveDIDKey resolves a did:key:z<base58btc> DID to an Ed25519 public key. Only the Ed25519 multicodec prefix (0xed01) is supported.

Types

type CachedKeyStore

type CachedKeyStore struct {
	// contains filtered or unexported fields
}

CachedKeyStore wraps a KeyStore with a TTL cache.

func NewCachedKeyStore

func NewCachedKeyStore(inner KeyStore, ttl time.Duration) *CachedKeyStore

NewCachedKeyStore wraps inner with a TTL-based cache.

func (*CachedKeyStore) PublicKey

func (c *CachedKeyStore) PublicKey(agentID string) (ed25519.PublicKey, error)

PublicKey returns the public key for agentID, using the cache when valid.

type FileKeyStore

type FileKeyStore struct {
	// contains filtered or unexported fields
}

FileKeyStore loads Ed25519 public keys from a YAML file.

func NewFileKeyStore

func NewFileKeyStore(path string) (*FileKeyStore, error)

NewFileKeyStore loads keys from path. A missing file is treated as an empty store and is not an error.

func (*FileKeyStore) PublicKey

func (fs *FileKeyStore) PublicKey(agentID string) (ed25519.PublicKey, error)

PublicKey returns the public key for agentID, or an error if not found.

type KeyStore

type KeyStore interface {
	PublicKey(agentID string) (ed25519.PublicKey, error)
}

KeyStore resolves Ed25519 public keys by agent ID.

Jump to

Keyboard shortcuts

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