package provider

import "aigateway.local/core/internal/platform/cryptox"

var ErrCredentialKeyUnavailable = cryptox.ErrKeyUnavailable

type CredentialCipher = cryptox.Keyring

func NewCredentialCipher(encodedKey string, version int, encodedKeyring ...string) (*CredentialCipher, error) {
	keyring := ""
	if len(encodedKeyring) > 0 {
		keyring = encodedKeyring[0]
	}
	return cryptox.NewKeyring(encodedKey, version, keyring, "provider-credentials")
}
