diskencryption

package
v2.16.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

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