The host uses this command to start sending secured files to the device for storage or processing. It is similar to Start Send File to Device (Unsecured) - Command 0xD812, but is used to send a different subset of file types that impact device security and require some form of authentication from the host. Refer to Table 206 to determine which file type requires a secure command. All files require the command to be authorized via a secure wrapper. In some cases, files include additional signatures within the file structure itself. This command is paired with Start Get File from Device - Command 0xD821, which the host can use to retrieve files. However, some file types are βone way onlyβ and cannot be retrieved using that command after the host sends them to the device.
The host determines which file type it will send to the device (see About Files), and either opens an existing file in its file system for reading, or begins constructing it.
The host constructs Start Send File to Device (Secured) - Command 0xD811 per Table XXX.
The host constructs Send Secured Command to Device - Command 0xEEEE using the previously constructed command as the payload, and sends that command to the device as a Request Message to start the process of uploading a file.
Sub-steps and notes for building the secured wrapper:
Use Get Key Info - Command 0xEF11 to gather information about the key to use to secure the message payload(s). Because this command requires a MAC, use key slot 1111.
The device sends a Response Message so the host knows it can begin sending the file.
The host sends a Data File Message to the device. If the device does not receive file data within a reasonable period of time, it times out and stops listening for the data file.
The device checks to make sure the File ID and the length and hash of the File Payload match with the values the host specified in this command.
The device repeats the same Response Message, this time with the Message Reference Number set to the same value the host used in the Data File Message.
If the request started successfully, the Request Status in the message wrapper is OK, Started / Running, All good / requested operation was successful.
Security Operation Type populated with the following values:
Operation Type = Command Authorization Using MAC
Operation Algorithm = CMAC
Operation Cipher = AES-256
Padding = One and zeros
MAC Block Size with any number
Key Information Type populated with the key information gathered earlier.
D811 = Start Send File to Device (Secured) - Command 0xD811
81
04
File ID from Table 206
B
R
A2
var
File transfer properties
T
R
/81
Var
Length of File Payload
This is the length of the File Payload parameter in the Data File Message the host sends to the device.
B
R
/82
01
Hash Checksum Type
0x04 = SHA-256
B
R
/83
20
Hash Checksum Anticipated checksum calculated against the File Payload, according to the standard specified in Hash Checksum Type.
B
R
A3
var
File Description The host should populate this value to help identify the file using Get File Info from Device. - Command 0xD825
T
R
/81
var
File Name Maximum length 32 bytes Reserved for future use. Leave empty.
B
O
Null
/82
var
File Label Maximum length 16 bytes Reserved for future use. Leave empty.
B
O
Null
/83
var
File Version Maximum length 7 bytes Reserved for future use. Leave empty.
B
O
Null
/84
var
File Date Maximum length 20 bytes Reserved for future use. Leave empty.
B
O
Null
87
01
Reserved for future use. Leave empty.
B
O
Null
End of any wrappers, at minimum including Request Message
D811 = Start Send File to Device (Secured) - Command 0xD811
No parameters.
End of any wrappers, at minimum including Response Message
Beginning of any wrappers, at minimum including Request Message
Beginning of any wrappers, at minimum including Response Message
AA 00 81 04 01 04 D8 11 84 81 8F EE EE A1 19 81 05 03 03 06 02 08 84 00 85 00 A8 0A 81 02 11 02 82 00 86 00 88 00 A9 00 82 04 FF FF FF F0 83 08 C9 65 45 F2 97 69 85 B1 84 4E D8 11 81 04 00 00 03 00 A2 2B 81 04 00 00 02 99 82 01 04 83 20 87 A4 B3 54 61 C5 CB D3 1D DC BA 9D 65 25 5A D4 6A 22 FA 51 5E FD 65 87 AF AC A8 8C 4F AF 80 9B A3 14 38 31 30 38 33 30 33 30 33 30 33 30 33 33 33 30 33 30 87 01 01 9E 10 7D E4 27 C8 A0 70 72 08 19 0A 1E 0A 3F 48 BB F1
AA 00 81 04 82 0C D8 11 82 04 00 00 00 00
For additional support, please contact MagTek Support.