2

I found some code here: https://stackoverflow.com/a/11535593/181771

which contains the following:

DEBUG_DN = new X500Principal("CN=Android Debug,O=Android,C=US");

What does the string in that constructor, specifically C=US refer to? Is it something United States specific?

I ask because I'm developing an app that will primarily be used in Ireland and I'd like to know if this is something I need to change.

Community
  • 1
  • 1
DaveDev
  • 41,155
  • 72
  • 223
  • 385

1 Answers1

4

It's a Distinguished Name (DN) Info 1 Info 2. Think of the "C=US" as similar to ".com". You're free to enter "C=IE" when you create an X500 Principal.

Your Android Debug certificate is not something you'll end up publishing to the Play Store, so it's okay to just leave that at its generated value. When you generate your release key for publication to the Play Store, you can enter your own values for the DN.

If your purpose is the same as in the answer you linked to, that is, to check if your APK is signed with an Android debug key, then you can just keep the values as you found them in the answer.

Barend
  • 17,296
  • 2
  • 61
  • 80
  • 1
    Also note that nobody every sees this DN so you can enter pretty much anything. – Nikolay Elenkov Feb 06 '14 at 13:51
  • I wouldn't mind seeing an example where someone takes the release certificate and creates this x500 principal. That said, is this even used / is required for android keystores? – StarWind0 Jun 02 '17 at 04:47