| .. | .. |
|---|
| 62 | 62 | } |
|---|
| 63 | 63 | |
|---|
| 64 | 64 | /** |
|---|
| 65 | | - * Validates the license stored in {@code licFile} and get the corresponding |
|---|
| 66 | | - * LicenseBean |
|---|
| 65 | + * Validates the license stored in {@code licFile} and get the corresponding LicenseBean |
|---|
| 67 | 66 | * <p> |
|---|
| 68 | 67 | * The validation includes: |
|---|
| 69 | 68 | * <ul> |
|---|
| .. | .. |
|---|
| 83 | 82 | } |
|---|
| 84 | 83 | |
|---|
| 85 | 84 | /** |
|---|
| 86 | | - * Validates the license stored in {@code licFile} and get the corresponding |
|---|
| 87 | | - * LicenseBean. The License date is not validated |
|---|
| 85 | + * Validates the license stored in {@code licFile} and get the corresponding LicenseBean. The License date is not validated |
|---|
| 88 | 86 | * <p> |
|---|
| 89 | 87 | * The validation includes: |
|---|
| 90 | 88 | * <ul> |
|---|
| .. | .. |
|---|
| 101 | 99 | public LicenseBean validateLicense(File licFile, boolean excludeDateValidation) throws SeCurisException { |
|---|
| 102 | 100 | LicenseBean licBean = load(licFile); |
|---|
| 103 | 101 | SignatureHelper.getInstance().validateSignature(licBean); |
|---|
| 104 | | - LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), |
|---|
| 105 | | - Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 102 | + LicenseValidator.getInstance().validateHW(licBean, Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 106 | 103 | LicenseValidator.getInstance().validateLogo(licBean); |
|---|
| 107 | 104 | |
|---|
| 108 | 105 | if (!excludeDateValidation) { |
|---|
| .. | .. |
|---|
| 121 | 118 | * @throws SeCurisException |
|---|
| 122 | 119 | */ |
|---|
| 123 | 120 | public SignedLicenseBean requestLicense(String nameOrReference, String email) throws SeCurisException { |
|---|
| 124 | | - RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), |
|---|
| 125 | | - Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 121 | + RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 126 | 122 | |
|---|
| 127 | 123 | SignedLicenseBean lic = requestLicenseToServer(req, nameOrReference, email); |
|---|
| 128 | 124 | return lic; |
|---|
| .. | .. |
|---|
| 174 | 170 | } |
|---|
| 175 | 171 | |
|---|
| 176 | 172 | /** |
|---|
| 177 | | - * Creates a new request file with current hardware in the File passed as |
|---|
| 178 | | - * parameter |
|---|
| 173 | + * Creates a new request file with current hardware in the File passed as parameter |
|---|
| 179 | 174 | * |
|---|
| 180 | 175 | * @param outputRequestFile |
|---|
| 181 | 176 | * File where the request data will be saved |
|---|
| .. | .. |
|---|
| 183 | 178 | * @throws SeCurisException |
|---|
| 184 | 179 | */ |
|---|
| 185 | 180 | public RequestBean createRequestFile(File outputRequestFile) throws SeCurisException { |
|---|
| 186 | | - RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), |
|---|
| 187 | | - Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 181 | + RequestBean req = ReqGenerator.getInstance().createRequest(Params.get(Params.KEYS.APPLICATION_CODE), Params.get(Params.KEYS.CUSTOMER_CODE), Params.get(Params.KEYS.PACK_CODE)); |
|---|
| 188 | 182 | |
|---|
| 189 | 183 | ReqGenerator.getInstance().save(req, outputRequestFile); |
|---|
| 190 | 184 | |
|---|
| .. | .. |
|---|
| 192 | 186 | } |
|---|
| 193 | 187 | |
|---|
| 194 | 188 | /** |
|---|
| 195 | | - * Send the current license file to server, which is previously validated, |
|---|
| 196 | | - * to get a renewed one if it is prepared in server side. |
|---|
| 189 | + * Send the current license file to server, which is previously validated, to get a renewed one if it is prepared in server side. |
|---|
| 197 | 190 | * |
|---|
| 198 | 191 | * @param licenseFile |
|---|
| 199 | 192 | * Current and valid License file |
|---|
| 200 | | - * @return New license bean if server creates a new one, otherwise the same |
|---|
| 201 | | - * current License bean will be returned |
|---|
| 193 | + * @return New license bean if server creates a new one, otherwise the same current License bean will be returned |
|---|
| 202 | 194 | * @throws SeCurisException |
|---|
| 203 | 195 | */ |
|---|
| 204 | 196 | public SignedLicenseBean renew(File licenseFile) throws SeCurisException { |
|---|
| 205 | | - LicenseBean lic = validateLicense(licenseFile); |
|---|
| 197 | + LicenseBean lic = validateLicense(licenseFile, true); |
|---|
| 206 | 198 | |
|---|
| 207 | 199 | SignedLicenseBean newLic = ConnectionManager.getInstance().executePost(Command.RENEW_LIC, SignedLicenseBean.class, lic); |
|---|
| 208 | 200 | |
|---|