PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/java-tourist/src/main/java/com/justin/workaround/JiraLicenseGenerator.java

http://justin-repository.googlecode.com/
Java | 86 lines | 81 code | 5 blank | 0 comment | 6 complexity | d371abb50ccb14baed8eecfd0f3aaf08 MD5 | raw file
  1. package com.justin.workaround;
  2. import java.io.IOException;
  3. import java.security.KeyFactory;
  4. import java.security.Signature;
  5. import java.security.spec.PKCS8EncodedKeySpec;
  6. import com.atlassian.license.LicensePair;
  7. public class JiraLicenseGenerator
  8. {
  9. static byte EncodedPrvKey[] = { 48, -126, 1, 75, 2, 1, 0, 48, -126, 1, 44, 6, 7, 42, -122, 72, -50, 56, 4, 1, 48,
  10. -126, 1, 31, 2, -127, -127, 0, -3, 127, 83, -127, 29, 117, 18, 41, 82, -33, 74, -100, 46, -20, -28,
  11. -25, -10, 17, -73, 82, 60, -17, 68, 0, -61, 30, 63, -128, -74, 81, 38, 105, 69, 93, 64, 34, 81, -5,
  12. 89, 61, -115, 88, -6, -65, -59, -11, -70, 48, -10, -53, -101, 85, 108, -41, -127, 59, -128, 29, 52,
  13. 111, -14, 102, 96, -73, 107, -103, 80, -91, -92, -97, -97, -24, 4, 123, 16, 34, -62, 79, -69, -87,
  14. -41, -2, -73, -58, 27, -8, 59, 87, -25, -58, -88, -90, 21, 15, 4, -5, -125, -10, -45, -59, 30, -61,
  15. 2, 53, 84, 19, 90, 22, -111, 50, -10, 117, -13, -82, 43, 97, -41, 42, -17, -14, 34, 3, 25, -99,
  16. -47, 72, 1, -57, 2, 21, 0, -105, 96, 80, -113, 21, 35, 11, -52, -78, -110, -71, -126, -94, -21,
  17. -124, 11, -16, 88, 28, -11, 2, -127, -127, 0, -9, -31, -96, -123, -42, -101, 61, -34, -53, -68,
  18. -85, 92, 54, -72, 87, -71, 121, -108, -81, -69, -6, 58, -22, -126, -7, 87, 76, 11, 61, 7, -126,
  19. 103, 81, 89, 87, -114, -70, -44, 89, 79, -26, 113, 7, 16, -127, -128, -76, 73, 22, 113, 35, -24,
  20. 76, 40, 22, 19, -73, -49, 9, 50, -116, -56, -90, -31, 60, 22, 122, -117, 84, 124, -115, 40, -32,
  21. -93, -82, 30, 43, -77, -90, 117, -111, 110, -93, 127, 11, -6, 33, 53, 98, -15, -5, 98, 122, 1, 36,
  22. 59, -52, -92, -15, -66, -88, 81, -112, -119, -88, -125, -33, -31, 90, -27, -97, 6, -110, -117, 102,
  23. 94, -128, 123, 85, 37, 100, 1, 76, 59, -2, -49, 73, 42, 4, 22, 2, 20, 42, 50, -88, 30, 125, -37,
  24. 118, -50, 20, -82, -63, 0, 8, -36, 106, -9, -110, 124, 107, 68 };
  25. public static void main(String args[]) throws IOException
  26. {
  27. try
  28. {
  29. long l = 267L;
  30. long l1 = System.currentTimeMillis();
  31. long l2 = System.currentTimeMillis();
  32. String s = "";
  33. System.out.println("Keygen for JIRA Enterprise Edition.");
  34. System.out.print("created by mydaj[ROR].");
  35. do
  36. {
  37. System.out.print("\nEnter your organization name: ");
  38. for (int i = System.in.read(); i != 10 && i != 13; i = System.in.read())
  39. s = s + (char) i;
  40. }
  41. while (s == "");
  42. try
  43. {
  44. PKCS8EncodedKeySpec pkcs8encodedkeyspec = new PKCS8EncodedKeySpec(EncodedPrvKey);
  45. KeyFactory keyfactory = KeyFactory.getInstance("DSA", "SUN");
  46. java.security.PrivateKey privatekey = keyfactory.generatePrivate(pkcs8encodedkeyspec);
  47. String s1 = Long.toString(l, 10);
  48. s1 = s1 + "^^";
  49. s1 = s1 + Long.toString(l1, 10);
  50. s1 = s1 + "^^";
  51. s1 = s1 + Long.toString(l2, 10);
  52. s1 = s1 + "^^";
  53. s1 = s1 + s;
  54. byte abyte0[] = s1.getBytes();
  55. Signature signature = Signature.getInstance("SHA1withDSA");
  56. signature.initSign(privatekey);
  57. signature.update(abyte0);
  58. byte abyte1[] = signature.sign();
  59. LicensePair licensepair = null;
  60. try
  61. {
  62. licensepair = new LicensePair(abyte0, abyte1);
  63. }
  64. catch (Exception exception1)
  65. {
  66. exception1.printStackTrace();
  67. }
  68. System.out.println(s1);
  69. System.out.println("Your license key is: ");
  70. System.out.println(licensepair.toString());
  71. }
  72. catch (Exception exception)
  73. {
  74. exception.printStackTrace();
  75. }
  76. }
  77. catch (IOException ioexception)
  78. {
  79. }
  80. }
  81. }