Documentation ¶
Overview ¶
Package diskencryption uses libcryptsetup to format and map crypt devices.
This is used by the disk-mapper to set up a node's state disk.
All interaction with libcryptsetup should be done here.
Index ¶
- type DiskEncryption
- func (d *DiskEncryption) DiskUUID() (string, error)
- func (d *DiskEncryption) FormatDisk(passphrase string) error
- func (d *DiskEncryption) IsInitialized() bool
- func (d *DiskEncryption) MapDisk(target, passphrase string) error
- func (d *DiskEncryption) UnmapDisk(target string) error
- func (d *DiskEncryption) Wipe(blockWipeSize int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskEncryption ¶
type DiskEncryption struct {
// contains filtered or unexported fields
}
DiskEncryption handles actions for formatting and mapping crypt devices.
func New ¶
func New(path string, log *slog.Logger) (*DiskEncryption, func(), error)
New creates a new crypt device for the device at path.
func (*DiskEncryption) DiskUUID ¶
func (d *DiskEncryption) DiskUUID() (string, error)
DiskUUID gets the device's UUID.
func (*DiskEncryption) FormatDisk ¶
func (d *DiskEncryption) FormatDisk(passphrase string) error
FormatDisk formats the disk and adds passphrase in keyslot 0.
func (*DiskEncryption) IsInitialized ¶
func (d *DiskEncryption) IsInitialized() bool
IsInitialized returns true if the device is formatted as a LUKS device, and has been successfully initialized before (successfully joined a cluster).
func (*DiskEncryption) MapDisk ¶
func (d *DiskEncryption) MapDisk(target, passphrase string) error
MapDisk maps a crypt device to /dev/mapper/target using the provided passphrase.
func (*DiskEncryption) UnmapDisk ¶
func (d *DiskEncryption) UnmapDisk(target string) error
UnmapDisk removes the mapping of target.
func (*DiskEncryption) Wipe ¶
func (d *DiskEncryption) Wipe(blockWipeSize int) error
Wipe overwrites the device with zeros to initialize integrity checksums.