Generated from Manticore v1.1.5 • 201 packages. View on pkg.go.dev

headers

import "github.com/TheManticoreProject/Manticore/windows/keycredentiallink/key/material/fek/headers"

Index

type FEK\_KEY\_MATERIAL\_HEADER

FEK_KEY_MATERIAL_HEADER describes the sizes of the two components that make up the KEY_USAGE_FEK key material buffer: the RSA 2048 public key (PublicExponent and Modulus) and the AES-256 KDF key.

The header immediately follows the 1-byte FEK_KEY_MATERIAL_VERSION and precedes the raw RSA and AES-256 KDF key bytes. All integer fields are stored in little-endian.

See: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/735fd27a-3f22-4926-93f9-0298bb67a84b

type FEK_KEY_MATERIAL_HEADER struct {
    // BitLength is the size, in bits, of the RSA key. For KEY_USAGE_FEK this MUST be 2048.
    BitLength uint32

    // CbPublicExp is the size, in bytes, of the RSA public exponent.
    CbPublicExp uint32

    // CbModulus is the size, in bytes, of the RSA modulus.
    CbModulus uint32

    // CbAESKDFKey is the size, in bytes, of the AES-256 KDF key. For KEY_USAGE_FEK this MUST be 32.
    CbAESKDFKey uint32
}

func (*FEK_KEY_MATERIAL_HEADER) Describe

func (h *FEK_KEY_MATERIAL_HEADER) Describe(indent int)

Describe prints a detailed description of the FEK_KEY_MATERIAL_HEADER instance.

Parameters: - indent: An integer representing the indentation level for the printed output.

func (*FEK_KEY_MATERIAL_HEADER) Equal

func (h *FEK_KEY_MATERIAL_HEADER) Equal(other *FEK_KEY_MATERIAL_HEADER) bool

Equal checks if two FEK_KEY_MATERIAL_HEADER structures are equal.

Parameters: - other: The FEK_KEY_MATERIAL_HEADER structure to compare to.

Returns: - True if the two structures are equal, false otherwise.

func (*FEK_KEY_MATERIAL_HEADER) Marshal

func (h *FEK_KEY_MATERIAL_HEADER) Marshal() ([]byte, error)

Marshal returns the raw bytes of the FEK_KEY_MATERIAL_HEADER structure.

Returns: - A byte slice representing the raw bytes of the FEK_KEY_MATERIAL_HEADER structure.

func (*FEK_KEY_MATERIAL_HEADER) String

func (h *FEK_KEY_MATERIAL_HEADER) String() string

String returns a string representation of the FEK_KEY_MATERIAL_HEADER structure.

Returns: - A string representing the FEK_KEY_MATERIAL_HEADER structure.

func (*FEK_KEY_MATERIAL_HEADER) Unmarshal

func (h *FEK_KEY_MATERIAL_HEADER) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the FEK_KEY_MATERIAL_HEADER structure.

Parameters: - value: A byte slice containing the raw FEK key material header to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.