drive

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

README

Drive sub-library

This library represents the OS dependent actions of sending security commands to a supported device.

Documentation

Index

Constants

View Source
const (
	NVME_ADMIN_IDENTIFY = 0x06
	NVME_SECURITY_SEND  = 0x81
	NVME_SECURITY_RECV  = 0x82
)

Variables

View Source
var (
	ErrNotSupported = errors.New("operation is not supported")
)
View Source
var (
	NVME_IOCTL_ADMIN_CMD = ioctl.Iowr('N', 0x41, unsafe.Sizeof(nvmePassthruCommand{}))
)

Functions

func Certificate

func Certificate(d driveIntf) (*x509.Certificate, error)

Returns the X.509 security certificate from the drive.

func NVMEDrive

func NVMEDrive(fd FdIntf) *nvmeDrive

func Open

func Open(device string) (driveIntf, error)

func SCSIDrive

func SCSIDrive(fd FdIntf) *scsiDrive

Types

type FdIntf

type FdIntf interface {
	Fd() uintptr
}

type SecurityProtocol

type SecurityProtocol int
const (
	SecurityProtocolInformation   SecurityProtocol = 0
	SecurityProtocolTCGManagement SecurityProtocol = 1
	SecurityProtocolTCGTPer       SecurityProtocol = 2
)

func SecurityProtocols

func SecurityProtocols(d driveIntf) ([]SecurityProtocol, error)

Returns a list of supported security protocols.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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