details:   https://code.openbravo.com/erp/devel/pi/rev/17c6f2da9596
changeset: 33410:17c6f2da9596
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Thu Feb 08 09:25:40 2018 +0100
summary:   realted to issue 37849: remove system key hash in log files

  Restored ActivationKey.getOpsLogId method as it is public and used

diffstat:

 src/org/openbravo/erpCommon/obps/ActivationKey.java |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r 2615e116021b -r 17c6f2da9596 
src/org/openbravo/erpCommon/obps/ActivationKey.java
--- a/src/org/openbravo/erpCommon/obps/ActivationKey.java       Thu Feb 08 
08:28:54 2018 +0100
+++ b/src/org/openbravo/erpCommon/obps/ActivationKey.java       Thu Feb 08 
09:25:40 2018 +0100
@@ -9,7 +9,7 @@
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific  language  governing  rights  and  limitations
  * under the License. 
- * The Original Code is Openbravo ERP. 
+ * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU 
  * All portions are Copyright (C) 2009-2018 Openbravo SLU 
  * All Rights Reserved. 
@@ -51,6 +51,7 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+import java.util.zip.CRC32;
 
 import javax.crypto.Cipher;
 import javax.enterprise.inject.spi.Bean;
@@ -745,6 +746,13 @@
     return licenseClass == null ? LicenseClass.COMMUNITY : licenseClass;
   }
 
+  /** Returns a CRC hash of the public key */
+  public String getOpsLogId() {
+    CRC32 crc = new CRC32();
+    crc.update(getPublicKey().getBytes());
+    return Long.toHexString(crc.getValue());
+  }
+
   private PublicKey getPublicKey(String strPublickey) {
     try {
       KeyFactory keyFactory = KeyFactory.getInstance("RSA");

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to