credentialcipher

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialMasterKeyEnv    = "DRS_CREDENTIAL_MASTER_KEY"
	CredentialLocalKeyFileEnv = "DRS_CREDENTIAL_LOCAL_KEY_FILE"
	DatabaseSQLiteFileEnv     = "DRS_DB_SQLITE_FILE"
	CredentialKeyManagerEnv   = "DRS_CREDENTIAL_KEY_MANAGER"
	CredentialKMSKeyIDEnv     = "DRS_CREDENTIAL_KMS_KEY_ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cipher added in v0.4.2

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

func New added in v0.4.3

func New(cfg Config) (*Cipher, error)

func NewFromEnv added in v0.4.2

func NewFromEnv() (*Cipher, error)

func (*Cipher) DecryptField added in v0.4.2

func (c *Cipher) DecryptField(ctx context.Context, value string) (string, error)

func (*Cipher) Enabled added in v0.4.2

func (c *Cipher) Enabled() (bool, error)

func (*Cipher) EncryptField added in v0.4.2

func (c *Cipher) EncryptField(ctx context.Context, plaintext string) (string, error)

func (*Cipher) Parse added in v0.4.2

func (c *Cipher) Parse(ctx context.Context, cred *buckets.Credential) (*buckets.Credential, error)

func (*Cipher) Prepare added in v0.4.2

func (c *Cipher) Prepare(ctx context.Context, cred *buckets.Credential) (*buckets.Credential, error)

type Config added in v0.4.3

type Config struct {
	MasterKey    string
	LocalKeyFile string
	SQLiteFile   string
	KeyManager   string
	KMSKeyID     string
}

func ConfigFromEnv added in v0.4.3

func ConfigFromEnv() Config

ConfigFromEnv reads deployment settings once at the construction boundary.

type CredentialKeyManager

type CredentialKeyManager interface {
	Name() string
	WrapDataKey(ctx context.Context, dataKey []byte) (*WrappedDataKey, error)
	UnwrapDataKey(ctx context.Context, wrapped *WrappedDataKey) ([]byte, error)
}

type WrappedDataKey

type WrappedDataKey struct {
	Manager    string
	KeyID      string
	Ciphertext string
}

Jump to

Keyboard shortcuts

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