cryptsetupclient

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptSetup

type CryptSetup struct {
	// contains filtered or unexported fields
}

CryptSetup manages encrypted devices.

func NewCryptSetup

func NewCryptSetup() CryptSetup

func (CryptSetup) Init

func (c CryptSetup) Init(devicePath string) (Device, error)

Init opens a crypt device by device path.

func (CryptSetup) InitByName

func (c CryptSetup) InitByName(name string) (Device, error)

InitByName opens an active crypt device using its mapped name.

type CryptSetupClient

type CryptSetupClient interface {
	Init(string) (Device, error)
	InitByName(string) (Device, error)
}

type Device

type Device interface {
	Format(cryptsetup.DeviceType, cryptsetup.GenericParams) error
	KeyslotAddByVolumeKey(int, string, string) error
	ActivateByVolumeKey(deviceName string, volumeKey string, volumeKeySize int, flags int) error
	ActivateByPassphrase(deviceName string, keyslot int, passphrase string, flags int) error
	VolumeKeyGet(keyslot int, passphrase string) ([]byte, int, error)
	Load(cryptsetup.DeviceType) error
	Free() bool
	Dump() int
	Type() string
	Deactivate(string) error
}

type LuksDevice

type LuksDevice struct {
	Identifier string
	Device     Device
}

func NewLuksDevice

func NewLuksDevice(crypt CryptSetupClient, path string) (LuksDevice, error)

func NewLuksDeviceByName

func NewLuksDeviceByName(crypt CryptSetupClient, name string) (LuksDevice, error)

Jump to

Keyboard shortcuts

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