credentialcipher

package
v0.4.1 Latest Latest
Warning

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

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

func CredentialEncryptionEnabled

func CredentialEncryptionEnabled() (bool, error)

func DecryptCredentialField

func DecryptCredentialField(ctx context.Context, value string) (string, error)

func EncryptCredentialField

func EncryptCredentialField(ctx context.Context, plaintext string) (string, error)

func ParseS3CredentialFromStorage

func ParseS3CredentialFromStorage(ctx context.Context, cred *buckets.Credential) (*buckets.Credential, error)

func PrepareS3CredentialForStorage

func PrepareS3CredentialForStorage(ctx context.Context, cred *buckets.Credential) (*buckets.Credential, error)

Types

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