credentialcipher

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 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
}

Cipher encrypts and decrypts credential fields using the key manager selected at construction time. Key material is still loaded by the manager when an operation needs it.

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 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