crypto

package
v1.8.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MapperFilePathPrefix = "/dev/mapper"

	CryptoKeyDefaultCipher = "aes-xts-plain64"
	CryptoKeyDefaultHash   = "sha256"
	CryptoKeyDefaultSize   = "256"
	CryptoDefaultPBKDF     = "argon2i"
)

Variables

This section is empty.

Functions

func CloseBackingImage

func CloseBackingImage(uuid string) error

CloseBackingImage closes encrypted backing image so it can be detached.

func DeviceEncryptionStatus

func DeviceEncryptionStatus(devicePath string) (mappedDevice, mapper string, err error)

DeviceEncryptionStatus looks to identify if the passed device is a LUKS mapping and if so what the device is and the mapper name as used by LUKS. If not, just returns the original device and an empty string.

func EncryptBackingImage

func EncryptBackingImage(devicePath, passphrase string, cryptoParams *EncryptParams) error

EncryptBackingImage encrypts provided device with LUKS.

func IsEncryptedDeviceOpened

func IsEncryptedDeviceOpened(device string) (bool, error)

IsEncryptedDeviceOpened determines if encrypted device is already open.

func OpenBackingImage

func OpenBackingImage(devicePath, passphrase, uuid string) error

OpenBackingImage opens backing image so that it can be used by the client.

Types

type EncryptParams

type EncryptParams struct {
	KeyProvider string
	KeyCipher   string
	KeyHash     string
	KeySize     string
	PBKDF       string
}

EncryptParams keeps the customized cipher options from the secret CR

func NewEncryptParams

func NewEncryptParams(keyProvider, keyCipher, keyHash, keySize, pbkdf string) *EncryptParams

func (*EncryptParams) GetKeyCipher

func (cp *EncryptParams) GetKeyCipher() string

func (*EncryptParams) GetKeyHash

func (cp *EncryptParams) GetKeyHash() string

func (*EncryptParams) GetKeySize

func (cp *EncryptParams) GetKeySize() string

func (*EncryptParams) GetPBKDF

func (cp *EncryptParams) GetPBKDF() string

Jump to

Keyboard shortcuts

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