Documentation ¶
Index ¶
- Variables
- func Cryptsetup(d Disk, md *Metadata, ek, tpmKek []byte) error
- func Execute()
- func InitModules()
- type Disk
- type Driver
- type Metadata
- func (m *Metadata) Cipher() string
- func (m *Metadata) DecryptKey(ek, tpmKek []byte) ([]byte, error)
- func (m *Metadata) EncryptKey(key, tpmKek []byte) ([]byte, error)
- func (m *Metadata) HexID() string
- func (m *Metadata) ID() string
- func (m *Metadata) Kek() string
- func (m *Metadata) TpmVersion() TpmVersionID
- func (m *Metadata) Write(f *os.File) error
- type TpmVersionID
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Pre-defined errors
Functions ¶
func Cryptsetup ¶
Cryptsetup invokes cryptsetup to open crypt device. ek is the encrypted encryption key.
Types ¶
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
Disk represents a physical disk to be encrypted.
func (Disk) CryptDevice ¶
CryptDevice returns the crypt device filename of this disk.
func (Disk) SectorSize ¶
SectorSize returns the physical block size of this disk.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver setup crypt devices.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata represents metadata block at the head of disk.
func NewMetadata ¶
func NewMetadata(cipher string, keySize int, tpmVersion TpmVersionID) (*Metadata, error)
NewMetadata initializes a new Metadata.
func ReadMetadata ¶
ReadMetadata read metadata from f. If metadata does not exist, this returns ErrNotFound.
func (*Metadata) DecryptKey ¶
DecryptKey decrypts encrypted key.
func (*Metadata) EncryptKey ¶
EncryptKey encrypts key.
func (*Metadata) TpmVersion ¶ added in v2.4.5
func (m *Metadata) TpmVersion() TpmVersionID
TpmVersion returns TPM version ID.
type TpmVersionID ¶ added in v2.4.5
type TpmVersionID int
TpmVersionID represents TPM versions.
const ( TpmNone TpmVersionID = 0 Tpm12 TpmVersionID = 1 Tpm20 TpmVersionID = 2 )
TPM versions.
func (TpmVersionID) String ¶ added in v2.4.5
func (v TpmVersionID) String() string
Click to show internal directories.
Click to hide internal directories.