> 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/api-and-command-reference/dynafamily-programmers-manual/commands/0xennn-security/0xef11-get-key-info.md).

# 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 %}

## 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><a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0xennn-security/0xef11-get-key-info"><mark style="color:red;"><strong>Command 0xEF11 - Get Key Info</strong></mark></a></td><td></td><td></td><td></td></tr><tr><td>81</td><td align="right">02</td><td><a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/data-types-and-shared-tlv-data-objects/tr-31-key-block-type"><mark style="color:red;"><strong>Key Slot ID</strong></mark></a> </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>

## 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>Get Key Info - Command 0xEF11</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 <a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/data-types-and-shared-tlv-data-objects/tr-31-key-block-type#key-slot-ids-a"><mark style="color:red;"><strong>Key Slot ID</strong></mark></a> 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 <a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/data-types-and-shared-tlv-data-objects/tr-31-key-block-type#key-slot-ids-a"><mark style="color:red;"><strong>Key Slot ID</strong></mark></a></p><p>This specifies the key used to secure and load the key that the host is retrieving information about. See <a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/data-types-and-shared-tlv-data-objects/tr-31-key-block-type#key-slot-ids-a"><mark style="color:red;"><strong>Key Slot ID</strong></mark></a></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 <a href="https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/data-types-and-shared-tlv-data-objects/tr-31-key-block-type#magtek-custom-key-data-fields"><mark style="color:red;"><strong>TR-31 Key Type Table - Usage/Algorithm/Mode.</strong></mark></a></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>

#### Request Example&#x20;

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

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

{% endcode %}

#### 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 %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0xennn-security/0xef11-get-key-info.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
