Documentation ¶
Overview ¶
Package luks provides a way to call LUKS2 cryptsetup.
Package luks provides a way to call LUKS2 cryptsetup.
Index ¶
- Constants
- func ValidatePerfOption(value string) error
- type Cipher
- type LUKS
- func (l *LUKS) AddKey(devname string, key, newKey *encryption.Key) error
- func (l *LUKS) CheckKey(devname string, key *encryption.Key) (bool, error)
- func (l *LUKS) Close(devname string) error
- func (l *LUKS) Encrypt(deviceName string, key *encryption.Key) error
- func (l *LUKS) Open(deviceName string, key *encryption.Key) (string, error)
- func (l *LUKS) ReadKeyslots(deviceName string) (*encryption.Keyslots, error)
- func (l *LUKS) ReadToken(devname string, slot int, token token.Token) error
- func (l *LUKS) RemoveKey(devname string, slot int, key *encryption.Key) error
- func (l *LUKS) RemoveToken(devname string, slot int) error
- func (l *LUKS) Resize(devname string, key *encryption.Key) error
- func (l *LUKS) SetKey(devname string, oldKey, newKey *encryption.Key) error
- func (l *LUKS) SetToken(devname string, slot int, token token.Token) error
- type Option
- type Token
Constants ¶
const ( // AESXTSPlain64CipherString string representation of aes-xts-plain64 cipher. AESXTSPlain64CipherString = "aes-xts-plain64" // XChaCha12String string representation of xchacha12 cipher. XChaCha12String = "xchacha12,aes-adiantum-plain64" // XChaCha20String string representation of xchacha20 cipher. XChaCha20String = "xchacha20,aes-adiantum-plain64" // AESXTSPlain64Cipher represents aes-xts-plain64 encryption cipher. AESXTSPlain64Cipher Cipher = iota // XChaCha12Cipher represents xchacha12 encryption cipher. XChaCha12Cipher // XChaCha20Cipher represents xchacha20 encryption cipher. XChaCha20Cipher )
const ( // PerfNoReadWorkqueue sets --perf-no_read_workqueue. PerfNoReadWorkqueue = "no_read_workqueue" // PerfNoWriteWorkqueue sets --perf-no_write_workqueue. PerfNoWriteWorkqueue = "no_write_workqueue" // PerfSameCPUCrypt sets --perf-same_cpu_crypt. PerfSameCPUCrypt = "same_cpu_crypt" )
Variables ¶
This section is empty.
Functions ¶
func ValidatePerfOption ¶
ValidatePerfOption checks that specified string is a valid perf option.
Types ¶
type Cipher ¶
type Cipher int
Cipher LUKS2 cipher type.
func ParseCipherKind ¶
ParseCipherKind converts cipher string into cipher type.
type LUKS ¶
type LUKS struct {
// contains filtered or unexported fields
}
LUKS implements LUKS2 encryption provider.
func (*LUKS) AddKey ¶
func (l *LUKS) AddKey(devname string, key, newKey *encryption.Key) error
AddKey adds a new key at the LUKS encryption slot.
func (*LUKS) Encrypt ¶
func (l *LUKS) Encrypt(deviceName string, key *encryption.Key) error
Encrypt implements encryption.Provider.
func (*LUKS) ReadKeyslots ¶
func (l *LUKS) ReadKeyslots(deviceName string) (*encryption.Keyslots, error)
ReadKeyslots returns deserialized LUKS2 keyslots JSON.
func (*LUKS) RemoveToken ¶ added in v0.4.6
RemoveToken removes token from the luks metadata.
func (*LUKS) Resize ¶ added in v0.4.7
func (l *LUKS) Resize(devname string, key *encryption.Key) error
Resize implements encryption.Provider.
type Option ¶
type Option func(l *LUKS)
Option represents luks configuration callback.
func WithIterTime ¶
WithIterTime sets iter-time parameter.
func WithPBKDFForceIterations ¶
WithPBKDFForceIterations sets pbkdf-force-iterations parameter.
func WithPBKDFMemory ¶
WithPBKDFMemory sets pbkdf-memory parameter.
func WithPerfOptions ¶
WithPerfOptions enables encryption perf options.