cryptsetupclient

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

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