# Getting License Key

**URL:** <https://forum.inductiveautomation.com/t/getting-license-key/16755>\
**Category:** General Discussion\
**Created:** [January 26, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/getting-license-key/16755 "2018-01-26T15:32:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [January 26, 2018, 3:32pm UTC](https://forum.inductiveautomation.com/t/getting-license-key/16755/1 "2018-01-26T15:32:12Z")

</div>

I always like to display the Ignition license key in all my applications. Currently i display the key as label from a tag in the Gateway i manually edit.  
i there a way to query the internal ‘works’ of the gateway to get the actual key?

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4a172ec9f417440fb73e4a70230981bead4c0ced.png)

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 26, 2018, 4:32pm UTC](https://forum.inductiveautomation.com/t/getting-license-key/16755/2 "2018-01-26T16:32:14Z")

</div>

In a message handler, put the following

```auto
	from com.inductiveautomation.ignition.gateway import SRContext
	
	context = SRContext.get()
	
	resp = {"primary key":None,"secondary keys":[]}
	
	resp["primary key"] = str(context.getLicenseManager().getLicense().getCDKey().toString())
	for key in context.getLicenseManager().getSecondaryLicenses():
		resp["secondary keys"].append(str(key.getCDKey().toString()))
	return resp

```

Now, invoke that with system.util.sendRequest or sendRequestAsync, and voila!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 26, 2018, 5:07pm UTC](https://forum.inductiveautomation.com/t/getting-license-key/16755/3 "2018-01-26T17:07:17Z")

</div>

You should blur that CD key 😲

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [January 26, 2018, 5:17pm UTC](https://forum.inductiveautomation.com/t/getting-license-key/16755/4 "2018-01-26T17:17:00Z")

</div>

oops, suppose you are correct. Can trust no one nowadays
