#593 fix - Added further information when license is not valid due to HW
validation
| .. | .. |
|---|
| 79 | 79 | log.info("License file {} is valid", file.getAbsolutePath()); |
|---|
| 80 | 80 | } catch (SeCurisException e) { |
|---|
| 81 | 81 | log.info("License file {} is NOT valid", file.getAbsolutePath()); |
|---|
| 82 | + log.info("Reason: {}", e.toString()); |
|---|
| 82 | 83 | } |
|---|
| 83 | 84 | |
|---|
| 84 | 85 | System.exit(0); |
|---|
| .. | .. |
|---|
| 47 | 47 | |
|---|
| 48 | 48 | public void prepareSignature(Signature signature, LicenseBean licBean) throws SeCurisException { |
|---|
| 49 | 49 | try { |
|---|
| 50 | | - log.info("JSON: {}", JsonUtils.toJSON(licBean)); |
|---|
| 51 | 50 | signature.update(JsonUtils.toJSON(licBean).getBytes("utf-8")); |
|---|
| 52 | 51 | signature.update(AUX.getBytes("utf-8")); |
|---|
| 53 | | - |
|---|
| 54 | 52 | } catch (SignatureException | UnsupportedEncodingException e) { |
|---|
| 55 | 53 | throw new SeCurisException("Error generating or validating signature", e); |
|---|
| 56 | 54 | } |
|---|
| .. | .. |
|---|
| 94 | 92 | KeyFactory keyFactory = KeyFactory.getInstance(DEFAULT_ALGORITHM); |
|---|
| 95 | 93 | X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(Base64.decodeBase64(pubKeyBase64)); |
|---|
| 96 | 94 | PublicKey publicKey = keyFactory.generatePublic(publicKeySpec); |
|---|
| 97 | | - log.info("Public key read sucessfully from file: {}", publicKeyFile.getAbsolutePath()); |
|---|
| 95 | + log.debug("Public key read sucessfully from file: {}", publicKeyFile.getAbsolutePath()); |
|---|
| 98 | 96 | return publicKey; |
|---|
| 99 | 97 | } |
|---|
| 100 | 98 | |
|---|
| .. | .. |
|---|
| 135 | 135 | public static void main(String[] args) throws SeCurisException { |
|---|
| 136 | 136 | Paths.get(new File("/Users/cproberto/Documents/wsCurisIT/SeCurisClient/license.req").toURI()); |
|---|
| 137 | 137 | |
|---|
| 138 | | - RequestBean req = ReqGenerator.getInstance().loadRequest(new File("/Users/cproberto/Downloads/license.req")); |
|---|
| 138 | + RequestBean req = ReqGenerator.getInstance().loadRequest(new File("/Users/cproberto/Desktop/lic_win.req")); |
|---|
| 139 | 139 | Map<String, Object> metadata = new TreeMap<>(); |
|---|
| 140 | 140 | metadata.put("maxUsers", 23); |
|---|
| 141 | 141 | metadata.put("maxInstances", 12); |
|---|
| 142 | 142 | LicenseBean lic = LicenseGenerator.getInstance().generateLicense(req, metadata, new Date(new Date().getTime() + 3600 * 1000), "CurisData01", "LIC-9812987123-12837129873"); |
|---|
| 143 | | - LicenseGenerator.getInstance().save(lic, new File("/Users/cproberto/Downloads/license_curisdata.lic")); |
|---|
| 143 | + LicenseGenerator.getInstance().save(lic, new File("/Users/cproberto/Desktop/license_win.lic")); |
|---|
| 144 | 144 | |
|---|
| 145 | 145 | System.out.print("os.arch: " + System.getProperty("os.arch") + " " + System.getProperty("os.name")); |
|---|
| 146 | 146 | |
|---|