Documentation
¶
Index ¶
Constants ¶
const ( // No flags specified. CustomKeyInformationFlags_None uint8 = 0 // Reserved for future use. (CUSTOMKEYINFO_FLAGS_ATTESTATION) CustomKeyInformationFlags_Attestation uint8 = 0x01 // During creation of this key, the requesting client authenticated using // only a single credential. (CUSTOMKEYINFO_FLAGS_MFA_NOT_USED) CustomKeyInformationFlags_MFANotUsed uint8 = 0x02 )
const ( // Volume not specified. CustomKeyInformationVolumeType_None uint8 = 0x00 // Operating system volume (OSV). CustomKeyInformationVolumeType_OperatingSystem uint8 = 0x01 // Fixed data volume (FDV). CustomKeyInformationVolumeType_Fixed uint8 = 0x02 // Removable data volume (RDV). CustomKeyInformationVolumeType_Removable uint8 = 0x03 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomKeyInformation ¶
type CustomKeyInformation struct {
// Version (1 byte): An 8-bit unsigned integer that MUST be set to 1.
Version int
// Flags (1 byte): An 8-bit unsigned integer that specifies zero or more of the following bit-flag values:
Flags CustomKeyInformationFlags
CurrentVersion int
ShortRepresentationSize int
ReservedSize int
// VolType (1 byte): An 8-bit unsigned integer that specifies one of the following volume types:
VolumeType CustomKeyInformationVolumeType
SupportsNotification bool
FekKeyVersion uint8
Strength strength.KeyStrength
Reserved []byte
EncodedExtendedCKI []byte
// Internal
RawBytes []byte
RawBytesSize uint32
}
CustomKeyInformation represents the CUSTOM_KEY_INFORMATION structure.
func (*CustomKeyInformation) Describe ¶
func (cki *CustomKeyInformation) Describe(indent int)
Describe prints a detailed description of the CustomKeyInformation instance.
Parameters: - indent: An integer representing the indentation level for the printed output.
Note: This function prints the Flags, VolumeType, SupportsNotification, FekKeyVersion, Strength, Reserved, and EncodedExtendedCKI values of the CustomKeyInformation instance. The output is formatted with the specified indentation level to improve readability.
func (*CustomKeyInformation) Marshal ¶
func (cki *CustomKeyInformation) Marshal() ([]byte, error)
Marshal returns the raw bytes of the CustomKeyInformation structure.
Returns: - A byte slice representing the raw bytes of the CustomKeyInformation structure. - An error if the conversion fails.
func (*CustomKeyInformation) Unmarshal ¶
func (cki *CustomKeyInformation) Unmarshal(data []byte, kcv version.KeyCredentialVersion) (int, error)
Unmarshal parses the provided byte slice into the CustomKeyInformation structure.
Parameters: - data: A byte slice containing the raw custom key information to be parsed. - version: The version of the key credential.
Returns: - The number of bytes read from the data. - An error if the parsing fails, otherwise nil.
Note: The function expects the byte slice to follow the CUSTOM_KEY_INFORMATION structure format. It extracts the version, flags, volume type, supports notification, FEK key version, strength, reserved, and encoded extended CKI fields from the byte slice. The parsed values are stored in the CustomKeyInformation structure.
type CustomKeyInformationFlags ¶
type CustomKeyInformationFlags struct {
Value uint8
Name []string
// Internal
RawBytes []byte
RawBytesSize uint32
}
CustomKeyInformationFlags represents custom key flags.
func (*CustomKeyInformationFlags) Unmarshal ¶
func (kf *CustomKeyInformationFlags) Unmarshal(data []byte) (int, error)
Unmarshal parses the provided byte slice into the CustomKeyInformationFlags structure.
Parameters: - value: A byte slice containing the raw key flags to be parsed.
Returns: - The number of bytes read from the data. - An error if the parsing fails, otherwise nil.
Note: The function expects the byte slice to contain a single byte representing the key flags. It extracts the flags value from the byte slice and assigns it to the CustomKeyInformationFlags structure.
type CustomKeyInformationVolumeType ¶
type CustomKeyInformationVolumeType struct {
Value uint8
// Internal
RawBytes []byte
RawBytesSize uint32
}
CustomKeyInformationVolumeType represents the volume type.
See: https://msdn.microsoft.com/en-us/library/mt220496.aspx
func (*CustomKeyInformationVolumeType) Describe ¶
func (vt *CustomKeyInformationVolumeType) Describe(indent int)
Describe prints a detailed description of the CustomKeyInformationVolumeType instance.
Parameters: - indent: An integer representing the indentation level for the printed output.
Note: This function prints the Value and Name of the CustomKeyInformationVolumeType instance. The output is formatted with the specified indentation level to improve readability.
func (*CustomKeyInformationVolumeType) Marshal ¶
func (vt *CustomKeyInformationVolumeType) Marshal() ([]byte, error)
Marshal returns the raw bytes of the CustomKeyInformationVolumeType structure.
Returns: - A byte slice representing the raw bytes of the CustomKeyInformationVolumeType structure. - An error if the conversion fails.
func (*CustomKeyInformationVolumeType) String ¶
func (vt *CustomKeyInformationVolumeType) String() string
String returns a string representation of the CustomKeyInformationVolumeType.
Returns: - A string representing the CustomKeyInformationVolumeType.
func (*CustomKeyInformationVolumeType) Unmarshal ¶
func (vt *CustomKeyInformationVolumeType) Unmarshal(data []byte) (int, error)
Unmarshal parses the provided byte slice into the CustomKeyInformationVolumeType structure.
Parameters: - data: A byte slice containing the raw volume type to be parsed.
Returns: - The number of bytes read from the data. - An error if the parsing fails, otherwise nil.
Note: The function expects the byte slice to contain a single byte representing the volume type. It extracts the volume type value from the byte slice and assigns it to the CustomKeyInformationVolumeType structure.