Versions in this module Expand all Collapse all v0 v0.0.1 Jan 17, 2026 Changes in this version + const DefaultPlatformURL + const TokenValidityDuration + const X25519KeySize + const XChaCha20NonceSize + var ErrAuthentication = errors.New("authentication failed") + var ErrChallengeCreation = errors.New("challenge creation failed") + var ErrDecryption = errors.New("decryption failed") + var ErrInvalidKey = errors.New("invalid ANY_LLM_KEY format") + var ErrProviderKeyFetch = errors.New("provider key fetch failed") + func DecryptData(encryptedDataBase64 string, privateKey []byte) (string, error) + func ExtractPublicKey(privateKey []byte) (string, error) + func LoadPrivateKey(base64PrivateKey string) ([]byte, error) + type ChallengeCreationError struct + Message string + StatusCode int + func (e *ChallengeCreationError) Error() string + func (e *ChallengeCreationError) Is(target error) bool + func (e *ChallengeCreationError) Unwrap() error + type Client struct + HTTPClient *http.Client + PlatformURL string + func NewClient(opts ...Option) *Client + func (c *Client) CreateChallenge(ctx context.Context, publicKey string) (*challengeResponse, error) + func (c *Client) DecryptProviderKeyValue(encryptedKey string, privateKey []byte) (string, error) + func (c *Client) FetchProviderKey(ctx context.Context, provider, accessToken string) (*providerKeyResponse, error) + func (c *Client) GetAccessToken(ctx context.Context, anyLLMKey string) (string, error) + func (c *Client) GetDecryptedProviderKey(ctx context.Context, anyLLMKey, provider string) (*DecryptedProviderKey, error) + func (c *Client) GetPublicKey(anyLLMKey string) (string, error) + func (c *Client) GetSolvedChallenge(ctx context.Context, anyLLMKey string) (uuid.UUID, error) + func (c *Client) RefreshAccessToken(ctx context.Context, anyLLMKey string) (string, error) + func (c *Client) RequestAccessToken(ctx context.Context, solvedChallenge uuid.UUID) (string, error) + func (c *Client) SolveChallenge(encryptedChallenge string, privateKey []byte) (uuid.UUID, error) + type DecryptedProviderKey struct + APIKey string + CreatedAt time.Time + ProjectID uuid.UUID + Provider string + ProviderKeyID uuid.UUID + UpdatedAt time.Time + type DecryptionError struct + Message string + func (e *DecryptionError) Error() string + func (e *DecryptionError) Is(target error) bool + func (e *DecryptionError) Unwrap() error + type InvalidKeyError struct + Message string + func (e *InvalidKeyError) Error() string + func (e *InvalidKeyError) Is(target error) bool + func (e *InvalidKeyError) Unwrap() error + type KeyComponents struct + Base64EncodedPrivateKey string + KeyID string + PublicKeyFingerprint string + func ParseAnyLLMKey(anyLLMKey string) (*KeyComponents, error) + type Option func(*Client) + func WithHTTPClient(client *http.Client) Option + func WithPlatformURL(url string) Option + type ProviderKeyFetchError struct + Message string + Provider string + StatusCode int + func (e *ProviderKeyFetchError) Error() string + func (e *ProviderKeyFetchError) Is(target error) bool + func (e *ProviderKeyFetchError) Unwrap() error