Documentation
¶
Index ¶
- Constants
- func ReadInventoryFromFile(filePathSpec string, publicKey ed25519.PublicKey) (*eeinvpb.Inventory, error)
- func VerifySignature(content *Content, publicKey ed25519.PublicKey) bool
- func WriteInventoryToFile(filePathSpec string, inventory *eeinvpb.Inventory, ...) error
- type Content
- type EEPROMFile
Constants ¶
View Source
const (
MagicNumber = uint16(0xFEAD)
)
Variables ¶
This section is empty.
Functions ¶
func ReadInventoryFromFile ¶
func VerifySignature ¶
VerifySignature verifies the signature of the Content instance using the provided public key
func WriteInventoryToFile ¶
Types ¶
type Content ¶
type Content struct {
MagicNumber uint16 // 0xFEAD
Len uint16 // Length of the payload
Signature [64]byte // ED25519 Signature of the payload (only the actual payload length)
Payload []byte // Payload of the EEPROM data (marshaled protobuf)
}
Content defines the layout of the EEPROM inventory data structure
func NewContent ¶
func NewContent(payload []byte, privateKey ed25519.PrivateKey) (*Content, error)
NewContent creates a new Content instance with the given payload and signs it with the provided private key
type EEPROMFile ¶
type EEPROMFile struct {
// contains filtered or unexported fields
}
func NewEEPROMFile ¶
func NewEEPROMFile(spec string) (*EEPROMFile, error)
NewEEPROMFile creates a new EEPROMFile instance the filePath is the path plus the offset and size in the form "path@offset:size"
func (*EEPROMFile) Read ¶
func (e *EEPROMFile) Read() ([]byte, error)
Read reads the EEPROM data from the file
func (*EEPROMFile) Write ¶
func (e *EEPROMFile) Write(data []byte) error
Write writes the EEPROM data to the file
Click to show internal directories.
Click to hide internal directories.