> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/hardware/~/revisions/aurjDoOhAcnQLHeoR1ks/card-readers/mms-dyna-devices/emv-common-kernel/dynaflex-ii-go/documents/developers-manuals/programmers-manual-commands/commands/security/get-key-info.md).

# Get Key Info

## Command 0xEF11 - Get Key Info

The host uses this command to retrieve information about a key slot, including details about the key stored in that slot. It can be used for several purposes, including:

* Determine if a key exists / has been loaded
* Get key derivation data to derive a DUKPT key
* Get transport key information to retrieve the appropriate transport key

Sequence of events:

{% stepper %}
{% step %}

### Construct request

The host constructs the command request in the format below.
{% endstep %}

{% step %}

### Send request

The host sends the command request to the device.
{% endstep %}

{% step %}

### Receive response

The device sends a response in the format below to the host.
{% endstep %}
{% endstepper %}

## Table - Request Data for Command 0xEF11 - Get Key Info

<table><thead><tr><th width="235">Tag</th><th width="73.33331298828125" align="right">Len</th><th>Value / Description</th><th width="74.3333740234375">Typ</th><th width="74.99993896484375">Req</th><th width="99.333251953125">Default</th></tr></thead><tbody><tr><td>Beginning of any wrappers, at minimum including <strong>Request Message</strong> </td><td align="right"></td><td></td><td></td><td></td><td></td></tr><tr><td>EF11</td><td align="right"></td><td><strong>Command 0xEF11 - Get Key Info</strong></td><td></td><td></td><td></td></tr><tr><td>81</td><td align="right">02</td><td>Key Slot ID — See <strong>Table 59 - Key Slot ID</strong> </td><td>B</td><td>R</td><td></td></tr><tr><td>End of any wrappers, at minimum including <strong>Request Message</strong> </td><td align="right"></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## Table - Response Data for Command 0xEF11 - Get Key Info

<table><thead><tr><th>Tag</th><th width="73.6666259765625" align="right">Len</th><th>Value / Description</th><th width="78.3333740234375">Typ</th><th width="75.99993896484375">Req</th><th width="90.666748046875">Default</th></tr></thead><tbody><tr><td>EF11 = <strong>Command 0xEF11 - Get Key Info</strong></td><td align="right"></td><td></td><td></td><td></td><td></td></tr><tr><td>81</td><td align="right">04</td><td>Key Slot Information</td><td>B</td><td>R</td><td></td></tr><tr><td>82</td><td align="right">06</td><td>Loaded Key Information</td><td>B</td><td>O</td><td></td></tr><tr><td>/null</td><td align="right">(1)</td><td><p>Key Slot Status</p><p>·       0x00 = Empty</p><p>·       0x01 = Loaded (Key not assigned purpose)</p><p>·       0x02 = Loaded &#x26; Active</p><p>·       0x03 = Exhausted (End of DUKPT key sequence</p><p>·       0x04 = Expired (Reserved, certificate status)</p><p>0xFF = Not supported in this device</p></td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td align="right">(1)</td><td><p>Key Slot Type</p><p>First byte of the Key Slot ID in the host’s request message.</p></td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td align="right">(2)</td><td><p>Transport Key Slot ID</p><p>This specifies the key used to secure and load the key that the host is retrieving information about. See Table 59 - Key Slot ID </p></td><td>B</td><td>R</td><td></td></tr><tr><td>82</td><td align="right">06</td><td>Loaded Key Information</td><td>B</td><td>O</td><td></td></tr><tr><td>/null</td><td align="right">(1)</td><td>Key Environment — ‘T’ = Test, ‘P’ = Production</td><td>A</td><td>R</td><td></td></tr><tr><td>/null</td><td align="right">(4)</td><td>TR-31 Attributes — See <strong>Table 55 - TR-31 Key Type Table - Usage/Algorithm/Mode.</strong></td><td>B</td><td>R</td><td></td></tr><tr><td>/null</td><td align="right">(1)</td><td>Encoding of Algorithm &#x26; Length:<br>- 0x01 = DEA<br>- 0x02 = 2TDEA<br>- 0x03 = 3TDEA<br>- 0x04 = AES128<br>- 0x05 = AES192<br>- 0x06 = AES256</td><td>B</td><td>R</td><td></td></tr><tr><td>83</td><td align="right">var</td><td>Key Check Value:<br>- For AES-CMAC, 5 bytes.<br>- For TDES-CMAC or TDES-CBCMAC, 3 bytes.</td><td>B</td><td>O</td><td></td></tr><tr><td>84</td><td align="right">var</td><td>Key Derivation Information — Contains the derivation block, key serial number (KSN), or key label, as appropriate for the key type.</td><td>B</td><td>O</td><td></td></tr><tr><td>A6</td><td align="right">var</td><td>Restrictions — Reserved. Do not include.</td><td>B</td><td>O</td><td></td></tr><tr><td>81</td><td align="right">02</td><td>DUKPT Restrictions — These restrictions come from the TR-31 block.</td><td>B</td><td>O</td><td></td></tr><tr><td>89</td><td align="right">var</td><td>Timestamp — This comes from the TR-31 block or from device’s real-time clock.</td><td>B</td><td>O</td><td></td></tr></tbody></table>

## Table - Request Example

{% code title="Example (hex)" %}

```
AA 00 81 04 01 21 EF 11 84 06 EF 11 81 02 20 07
```

{% endcode %}

## Table - Response Example

{% code title="Example (hex)" %}

```
AA 00 81 04 82 21 EF 11 82 04 00 00 00 00 84 34 A2 32 81 04 02 20 10 81 82 06 54 
42 31 54 58 03 84 0A FF FF 98 76 54 32 10 30 00 00 A6 04 81 02 00 3F 89 10 32 30 
32 30 30 39 30 32 54 31 35 35 38 30 32 5A
```

{% endcode %}

{% hint style="info" %}
Note: For additional support, please contact MagTek Support.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/hardware/~/revisions/aurjDoOhAcnQLHeoR1ks/card-readers/mms-dyna-devices/emv-common-kernel/dynaflex-ii-go/documents/developers-manuals/programmers-manual-commands/commands/security/get-key-info.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
