Documentation ¶
Overview ¶
Package encryption provides abstraction level for various disk encryption methods.
Index ¶
Constants ¶
View Source
const ( // LUKS2 encryption. LUKS2 = "luks2" // Unknown unecrypted or unsupported encryption. Unknown = "unknown" )
View Source
const AnyKeyslot = -1
AnyKeyslot tells providers to pick any keyslot.
Variables ¶
View Source
var ( // ErrEncryptionKeyRejected triggered when encryption key does not match. ErrEncryptionKeyRejected = fmt.Errorf("encryption key rejected") // ErrDeviceBusy returned when mapped device is still in use. ErrDeviceBusy = fmt.Errorf("mapped device is still in use") // ErrTokenNotFound returned when trying to get/delete not existing token. ErrTokenNotFound = fmt.Errorf("no token with supplied id exists") // ErrDeviceNotReady returned when device is not ready. ErrDeviceNotReady = fmt.Errorf("device is not ready") )
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { TokenProvider Encrypt(ctx context.Context, devname string, key *Key) error IsOpen(ctx context.Context, devname, mappedName string) (bool, string, error) Open(ctx context.Context, devname, mappedName string, key *Key) (string, error) Close(ctx context.Context, devname string) error AddKey(ctx context.Context, devname string, key, newKey *Key) error SetKey(ctx context.Context, devname string, key, newKey *Key) error CheckKey(ctx context.Context, devname string, key *Key) (bool, error) RemoveKey(ctx context.Context, devname string, slot int, key *Key) error ReadKeyslots(deviceName string) (*Keyslots, error) }
Provider represents encryption utility methods.
type TokenProvider ¶
type TokenProvider interface { SetToken(ctx context.Context, devname string, slot int, token token.Token) error ReadToken(ctx context.Context, devname string, slot int, token token.Token) error RemoveToken(ctx context.Context, devname string, slot int) error }
TokenProvider represents token management methods.
Click to show internal directories.
Click to hide internal directories.