diff --git a/README.md b/README.md
index a6188c173..21fac2960 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,6 @@ These are the source of the GeneXus Standard Classes for Java, valid since GeneX
| Name | Description
|---|---
| common | Classes common to Android and Java
-| gxcryptocommon | Classes common to Android and Java related to Cryptography
| gxmail | Classes related to mail handling
| java | Java standard classes, output is gxclassr.jar
| wrappercommon | Interfaces to encapsulate Java EE and Jakarta EE support, output is gxwrappercommon.jar
diff --git a/android/pom.xml b/android/pom.xml
index 3324e42a4..c25bbfb93 100644
--- a/android/pom.xml
+++ b/android/pom.xml
@@ -14,21 +14,6 @@
GeneXus Standard Classes for Android
-
- ${project.groupId}
- gxcryptocommon
- ${project.version}
-
-
- commons-io
- commons-io
-
-
- org.bouncycastle
- bcprov-jdk18on
-
-
-
${project.groupId}
gxcommon
diff --git a/android/src/main/java/com/genexus/cryptography/GXAsymEncryption.java b/android/src/main/java/com/genexus/cryptography/GXAsymEncryption.java
deleted file mode 100644
index bb06fb5b7..000000000
--- a/android/src/main/java/com/genexus/cryptography/GXAsymEncryption.java
+++ /dev/null
@@ -1,173 +0,0 @@
-package com.genexus.cryptography;
-
-import com.genexus.cryptography.encryption.asymmetric.CipherAsymProvider;
-import com.genexus.cryptography.encryption.asymmetric.IGXAsymEncryption;
-import com.genexus.cryptography.exception.AlgorithmNotSupportedException;
-import com.genexus.cryptography.exception.EncryptionException;
-import com.genexus.cryptography.exception.PrivateKeyNotFoundException;
-import com.genexus.cryptography.exception.PublicKeyNotFoundException;
-
-public class GXAsymEncryption {
-
- private static final String DEFAULT_SYM_ALGORITHM = "RSA";
- private static final String DEFAULT_SYM_PADDING = "PKCS1Padding";
- private static final String DEFAULT_SYM_MODE = "ECB";
-
- private static final String SHA256_SYM_PADDING = "OAEPWithSHA-256AndMGF1Padding";
-
- private int _lastError;
- private String _lastErrorDescription;
- private String _algorithm;
-
- private GXCertificate _cert;
- private IGXAsymEncryption _asymAlg;
- private boolean _isDirty;
-
- public GXAsymEncryption() {
- _isDirty = true;
- _algorithm = String.format("%s/%s/%s", DEFAULT_SYM_ALGORITHM,
- DEFAULT_SYM_MODE, DEFAULT_SYM_PADDING);
- initialize();
- }
-
- private void initialize() {
- if (_isDirty) {
- // Support algorithms = RSA only for now..
- // SHA256 ?
- setError(0);
-
- if (_cert != null && _cert.certLoaded() == true) {
- try {
- _asymAlg = new CipherAsymProvider(_algorithm,
- _cert.getPublicKey(), _cert.getPrivateKey());
- _isDirty = false;
- } catch (AlgorithmNotSupportedException e) {
- setError(2);
- }
- } else {
- setError(4);
- }
- }
- }
-
- public String encrypt(String text) {
- initialize();
- String encrypted = "";
- if (!anyError()) {
- try {
- encrypted = _asymAlg.encrypt(text);
- } catch (PublicKeyNotFoundException e) {
- setError(4);
- } catch (EncryptionException e) {
- setError(3);
- Utils.logError(e);
- }
- }
- return encrypted;
- }
-
- public String decrypt(String text) {
- initialize();
- String decrypted = "";
- if (!anyError()) {
-
- try {
- decrypted = _asymAlg.decrypt(text);
- } catch (PrivateKeyNotFoundException e) {
- setError(5);
- } catch (EncryptionException e) {
- setError(3);
- Utils.logError(e);
- }
- }
- return decrypted;
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = Constants.OK;
- break;
- case 1:
- break;
- case 2:
- _lastErrorDescription = Constants.ALGORITHM_NOT_SUPPORTED;
- break;
- case 3:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 4:
- _lastErrorDescription = "";
- break;
- case 5:
- _lastErrorDescription = Constants.PRIVATEKEY_NOT_PRESENT;
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- _lastErrorDescription = errDsc;
- }
- }
-
- public String getAlgorithm() {
- return _algorithm;
- }
-
- public void setAlgorithm(String value)
- {
- //Android , https://developer.android.com/reference/android/security/keystore/KeyProperties.html#KEY_ALGORITHM_AES
- // RSA == RSA
- // only support RSA https://developer.android.com/reference/javax/crypto/Cipher.html
- // change to Android KeyProperties
- //if (value.equalsIgnoreCase("SHA1")) { value = "HmacSHA1"; }
- //if (value.equalsIgnoreCase("SHA256")) { value = "HmacSHA256"; }
- //if (value.equalsIgnoreCase("SHA512")) { value = "HmacSHA512"; }
-
- // convert sha256 to RSA with sha256
- if (value.equalsIgnoreCase("SHA256"))
- {
- value = String.format("%s/%s/%s", DEFAULT_SYM_ALGORITHM, DEFAULT_SYM_MODE,
- SHA256_SYM_PADDING);
- }
- else
- {
- value = String.format("%s/%s/%s", value, DEFAULT_SYM_MODE,
- DEFAULT_SYM_PADDING);
- }
- _isDirty = _isDirty || !value.equals(_algorithm);
- _algorithm = value;
- }
-
- public GXCertificate getCertificate() {
- return _cert;
-
- }
-
- public void setCertificate(GXCertificate cert) {
- _isDirty = _isDirty || cert != _cert;
- _cert = cert;
- }
-
- private boolean anyError() {
-
- if (_cert == null || (!_cert.certLoaded() == true)) {
- setError(4); // Certificate not initialized
- }
- return _lastError != 0;
-
- }
-
- public int getErrCode() {
- return _lastError;
- }
-
- public String getErrDescription() {
- return _lastErrorDescription;
- }
-}
diff --git a/android/src/main/java/com/genexus/cryptography/GXSymEncryption.java b/android/src/main/java/com/genexus/cryptography/GXSymEncryption.java
deleted file mode 100644
index fb6c24d45..000000000
--- a/android/src/main/java/com/genexus/cryptography/GXSymEncryption.java
+++ /dev/null
@@ -1,214 +0,0 @@
-package com.genexus.cryptography;
-
-import java.security.NoSuchAlgorithmException;
-
-import javax.crypto.NoSuchPaddingException;
-
-import com.genexus.cryptography.encryption.symmetric.CipherSymProvider;
-import com.genexus.cryptography.encryption.symmetric.IGXSymEncryption;
-import com.genexus.cryptography.exception.AlgorithmNotSupportedException;
-import com.genexus.cryptography.exception.EncryptionException;
-import com.genexus.cryptography.exception.InvalidKeyLengthException;
-
-public class GXSymEncryption {
-
- private int _lastError;
- private String _lastErrorDescription;
- private IGXSymEncryption _symAlg; // Algorithm instance
- private String _algorithm;
- private String _key = ""; // key
- private String _iv = ""; // initialization vector
- private boolean isDirty;
- private int _keySize;
- private int _blockSize;
-
- public GXSymEncryption() {
- isDirty = true;
- _algorithm = String.format("%s/%s/%s", Constants.DEFAULT_SYM_ALGORITHM, Constants.DEFAULT_SYM_MODE,
- Constants.DEFAULT_SYM_PADDING);
- }
-
- private void Initialize() {
- if (isDirty) {
- // Supported algorithms = {Rijndael, DES, RC2, TripleDES}
- setError(0);
-
- try {
- _symAlg = new CipherSymProvider(_algorithm);
- if (validPropertyValue(_key)) {
- _symAlg.setKey(_key);
- }
- if (validPropertyValue(_iv)) {
- _symAlg.setIV(_iv);
- }
- if (_blockSize > 0) {
- _symAlg.setBlockSize(_blockSize);
- }
- if (_keySize > 0) {
- _symAlg.setKeySize(_keySize);
- }
- isDirty = false;
- } catch (NoSuchAlgorithmException e) {
- setError(2);
- Utils.logError(e);
- } catch (NoSuchPaddingException e) {
- setError(3);
- Utils.logError(e);
- } catch (InvalidKeyLengthException e) {
- setError(4, e.getMessage());
- Utils.logError(e);
- } catch (AlgorithmNotSupportedException e) {
- setError(2);
- Utils.logError(e);
- }
-
- }
- }
-
- private boolean validPropertyValue(String value) {
- return value != null && !value.equals("");
- }
-
- public String encrypt(String text) {
- Initialize();
- String encrypted = "";
- if (!anyError()) {
- try {
- encrypted = _symAlg.encrypt(text);
- } catch (EncryptionException e) {
- setError(1);
- Utils.logError(e);
- }
- }
- return encrypted;
- }
-
- public String decrypt(String text) {
- Initialize();
- String decrypted = "";
- if (!anyError()) {
- try {
- if (getIV().equals("")){
- setError(5);
- return "";
- }
- decrypted = _symAlg.decrypt(text);
- } catch (EncryptionException e) {
- setError(1);
- Utils.logError(e);
- }
- }
- return decrypted;
- }
-
- public String getAlgorithm() {
- return _algorithm;
- }
-
- public void setAlgorithm(String algorithm)
- {
- //Android , https://developer.android.com/reference/android/security/keystore/KeyProperties.html#KEY_ALGORITHM_AES
- // Rijndael == AES
- // TripleDES == DESede
- // SHA-256 == HmacSHA256
- // change to Android KeyProperties
- if (algorithm.equalsIgnoreCase("Rijndael")) { algorithm = "AES"; }
- if (algorithm.equalsIgnoreCase("TripleDES")) { algorithm = "DESede"; }
- if (algorithm.equalsIgnoreCase("SHA-256")) { algorithm = "HmacSHA256"; }
-
-
- algorithm = String.format("%s/%s/%s", algorithm, Constants.DEFAULT_SYM_MODE, Constants.DEFAULT_SYM_PADDING);
- isDirty = isDirty || !this._algorithm.equals(algorithm);
- this._algorithm = algorithm;
- }
-
- public String getKey() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getKey();
- return _key;
- }
-
- public void setKey(String key) {
- isDirty = isDirty || !this._key.equals(key);
- this._key = key;
- }
-
- public String getIV() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getIV();
- return _iv;
- }
-
- public void setIV(String iv) {
- isDirty = isDirty || !this._iv.equals(iv);
- this._iv = iv;
- }
-
- public int getKeySize() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getKeySize();
- return _keySize;
- }
-
- public void setKeySize(int keySize) {
- isDirty = isDirty || this._keySize != keySize;
- this._keySize = keySize;
-
- }
-
- public int getBlockSize() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getBlockSize();
- return _blockSize;
- }
-
- public void setBlockSize(int blockSize) {
- isDirty = isDirty || this._blockSize != blockSize;
- this._blockSize = blockSize;
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = "";
- break;
- case 1:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 2:
- _lastErrorDescription = Constants.ALGORITHM_NOT_SUPPORTED;
- break;
- case 3:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 4:
- _lastErrorDescription = Constants.KEY_NOT_VALID;
- break;
- case 5:
- _lastErrorDescription = "IV must be set for Decryption";
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- _lastErrorDescription = errDsc;
- }
- }
-
- private boolean anyError() {
- return _lastError != 0;
- }
-
- public int getErrCode() {
- return _lastError;
- }
-
- public String getErrDescription() {
- return _lastErrorDescription;
- }
-}
\ No newline at end of file
diff --git a/gxcryptocommon/pom.xml b/gxcryptocommon/pom.xml
deleted file mode 100644
index b54f8b607..000000000
--- a/gxcryptocommon/pom.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- 4.0.0
-
-
- com.genexus
- parent
- ${revision}${changelist}
-
-
- gxcryptocommon
- GeneXus Cryptography
-
-
-
- ${project.groupId}
- gxcommon
- ${project.version}
-
-
- org.bouncycastle
- bcpkix-jdk18on
- 1.75
-
-
- org.apache.santuario
- xmlsec
- 2.2.3
-
-
- *
- *
-
-
-
-
- org.slf4j
- slf4j-nop
- 1.7.7
-
-
- *
- *
-
-
-
-
-
-
- gxcryptocommon
-
-
diff --git a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXCertificate.java b/gxcryptocommon/src/main/java/com/genexus/cryptography/GXCertificate.java
deleted file mode 100644
index 4d01e3e52..000000000
--- a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXCertificate.java
+++ /dev/null
@@ -1,412 +0,0 @@
-package com.genexus.cryptography;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.security.GeneralSecurityException;
-import java.security.Key;
-import java.security.KeyFactory;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertPath;
-import java.security.cert.CertPathValidator;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.PKIXParameters;
-import java.security.cert.X509Certificate;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.List;
-
-import com.genexus.CommonUtil;
-import com.genexus.util.Base64;
-
-public class GXCertificate {
- // static readonly ILog log =
- // LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
-
- private X509Certificate _cert;
- private int _lastError;
- private String _lastErrorDescription;
- private String _alias;
- private PrivateKey _privateKey;
- private PublicKey _publicKey;
-
- public GXCertificate() {
-
- }
-
- public GXCertificate(String certPath, String storePassword) {
- load(certPath, storePassword);
- }
- public GXCertificate(String certPath, String storePassword, String pKeyPassword) {
- load(certPath, storePassword, pKeyPassword);
- }
-
- public int fromBase64(String base64Data) {
- try {
- byte[] dataBuffer = Base64.decode(base64Data);
- ByteArrayInputStream bI = new ByteArrayInputStream(dataBuffer);
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- _cert = (X509Certificate) cf.generateCertificate(bI);
- } catch (CertificateException e) {
- setError(1);
- Utils.logError(e);
- }
- return _lastError;
- }
-
- public int load(String certPath, String storePassword) {
- return load(certPath, storePassword, storePassword);
- }
- public int load(String certPath, String storePassword, String pKeyPassword) {
- setError(0);
- try (FileInputStream inStream = new FileInputStream(certPath)){
- String lowerCertPath = certPath.toLowerCase();
- if (lowerCertPath.endsWith(".pfx") || lowerCertPath.endsWith(".jks") || lowerCertPath.endsWith(".bks") || lowerCertPath.endsWith(".p12")) {
- KeyStore ks = null;
- if (lowerCertPath.endsWith(".pfx") || lowerCertPath.endsWith(".p12")) {
- ks = KeyStore.getInstance("PKCS12");
-
- } else if (lowerCertPath.endsWith(".bks")) {
- ks = KeyStore.getInstance("BKS");
-
- } else {
- ks = KeyStore.getInstance("JKS");
- }
- ks.load(inStream, storePassword.toCharArray());
- _alias = ks.aliases().nextElement();
- _cert = (X509Certificate) ks.getCertificate(_alias);
- _publicKey = _cert.getPublicKey();
- try {
- Key key = ks.getKey(_alias, pKeyPassword.toCharArray());
- PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(key.getEncoded());
- KeyFactory keyFactory = KeyFactory.getInstance("RSA");
- _privateKey = keyFactory.generatePrivate(keySpec);
- } catch (UnrecoverableKeyException e) {
- setError(5);
- }
- } else if (certPath.endsWith(".cer")) { // No private key
- CertificateFactory factory2 = CertificateFactory.getInstance("X.509");
- _cert = (X509Certificate) factory2.generateCertificate(inStream);
- _publicKey = _cert.getPublicKey();
- } else {
- setError(1);
- }
- } catch (FileNotFoundException e) {
- // Certificate Path is not valid.
- setError(3);
- } catch (KeyStoreException e) {
- setError(1);
- Utils.logError(e);
- } catch (NoSuchAlgorithmException e) {
- Utils.logError(e);
- } catch (CertificateException e) {
- setError(1);
- Utils.logError(e);
- } catch (IOException e) {
- setError(1);
- Utils.logError(e);
- } catch (InvalidKeySpecException e) {
- setError(1);
- Utils.logError(e);
- }
- return 0;
- }
-
- public String getSerialNumber() {
- String value = "";
- if (certLoaded()) {
- value = _cert.getSerialNumber().toString();
- value = new BigInteger(value).toString(16);
- }
- return value;
- }
-
- public String getSubject() {
-
- String value = "";
- if (certLoaded()) {
- value = _cert.getSubjectDN().getName();
- }
- return value;
-
- }
-
- public int getVersion() {
- int value = 0;
- if (certLoaded()) {
- value = _cert.getVersion();
- }
- return value;
-
- }
-
- public String getIssuer() {
-
- String value = "";
- if (certLoaded()) {
- value = _cert.getIssuerDN().getName();
- }
- return value;
-
- }
-
- public String getThumbprint() {
- return "";
- }
-
- public Date getNotAfter() {
-
- Date value = CommonUtil.resetTime(CommonUtil.nullDate());
- if (certLoaded()) {
- value = _cert.getNotAfter();
- }
- return value;
-
- }
-
- public Date getNotBefore() {
-
- Date value = CommonUtil.resetTime(CommonUtil.nullDate());
- if (certLoaded()) {
- value = _cert.getNotBefore();
- }
- return value;
-
- }
-
- public PrivateKey getPrivateKey() {
- return _privateKey;
-
- }
-
- public PublicKey getPublicKey() {
-
- return _publicKey;
- }
-
- public String toBase64() {
- String base64Encoded = "";
- if (certLoaded()) {
- try {
- base64Encoded = Base64.encodeBytes(_cert.getEncoded());
- setError(0);
- } catch (CertificateEncodingException e) {
- setError(6);
- Utils.logError(e);
- }
- } else {
- setError(1);
- }
- return base64Encoded;
- }
-
- public boolean hasPrivateKey() {
- if (certLoaded()) {
- return _privateKey != null;
- }
- return false;
- }
-
- /**
- * Verifies a certificate. Checks its validity period and tries to find a
- * trusted certificate from given list of trusted certificates that is
- * directly signed given certificate. The certificate is valid if no
- * exception is thrown.
- *
- * @param aCertificate
- * the certificate to be verified.
- * @param aTrustedCertificates
- * a list of trusted certificates to be used in the verification
- * process.
- *
- * @throws CertificateExpiredException
- * if the certificate validity period is expired.
- * @throws CertificateNotYetValidException
- * if the certificate validity period is not yet started.
- * @throws CertificateValidationException
- * if the certificate is invalid (can not be validated using the
- * given set of trusted certificates.
- */
-
- public void check() {
- try {
- // To check the validity of the dates
- _cert.checkValidity();
- // Check the chain
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- List mylist = new ArrayList();
- mylist.add(_cert);
- CertPath cp = cf.generateCertPath(mylist);
- PKIXParameters params = new PKIXParameters(getTrustStore());
- params.setRevocationEnabled(false);
- CertPathValidator cpv = CertPathValidator.getInstance(CertPathValidator.getDefaultType());
- cpv.validate(cp, params);
- } catch (Exception e) {
-
- }
- }
-
- private static KeyStore trustStore;
-
- public KeyStore getTrustStore() {
- if (trustStore == null) {
- FileInputStream is = null;
- try {
- String filename = System.getProperty("java.home")
- + "/lib/security/cacerts".replace('/', File.separatorChar);
- is = new FileInputStream(filename);
- KeyStore keyStore = KeyStore.getInstance("JKS");
- keyStore.load(is, "changeit".toCharArray());
- is.close();
- trustStore = keyStore;
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (KeyStoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (NoSuchAlgorithmException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (CertificateException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- finally {
- try {if (is != null) is.close();} catch (IOException e) {e.printStackTrace();}
- }
- }
- return trustStore;
- }
-
- public boolean verify() {
- if (certLoaded()) {
- return verifyCertificateFromCaCerts();
- }
- return false;
- }
-
- private boolean verifyCertificateFromCaCerts() {
- String filename = System.getProperty("java.home")
- + "/lib/security/cacerts".replace('/', File.separatorChar);
- try (FileInputStream is = new FileInputStream(filename);){
- KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
- String password = "changeit";
- keystore.load(is, password.toCharArray());
-
- Enumeration aliases = keystore.aliases();
- List certs = new ArrayList();
- while (aliases.hasMoreElements()) {
- String alias = aliases.nextElement();
- certs.add((X509Certificate) keystore.getCertificate(alias));
- }
-
- X509Certificate[] certsArray = certs.toArray(new X509Certificate[certs.size()]);
-
- return GXCertificate.verifyCertificate(_cert, certsArray);
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- return false;
- }
-
- private static boolean verifyCertificate(X509Certificate aCertificate, X509Certificate[] aTrustedCertificates)
- throws GeneralSecurityException {
- // First check certificate validity period
- aCertificate.checkValidity();
-
- // Check if the certificate is signed by some of the given trusted certs
- for (int i = 0; i < aTrustedCertificates.length; i++) {
- X509Certificate trustedCert = aTrustedCertificates[i];
- try {
- aCertificate.verify(trustedCert.getPublicKey());
- // Found parent certificate. Certificate is verified to be valid
- return true;
- } catch (GeneralSecurityException ex) {
- // Certificate is not signed by current trustedCert. Try the
- // next
- }
- }
-
- // Certificate is not signed by any of the trusted certs --> it is
- // invalid
- return false;
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = Constants.OK;
- break;
- case 1:
- _lastErrorDescription = Constants.CERT_NOT_LOADED;
- break;
- case 2:
- _lastErrorDescription = Constants.CERT_NOT_TRUSTED;
- break;
- case 3:
- _lastErrorDescription = Constants.CERT_NOT_FOUND;
- break;
- case 4:
- _lastErrorDescription = Constants.CERT_NOT_INITIALIZED;
- break;
- case 5:
- _lastErrorDescription = Constants.PRIVATEKEY_NOT_PRESENT;
- break;
- case 6:
- _lastErrorDescription = Constants.CERT_ENCODING_EXCEPTION;
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- if (!_lastErrorDescription.equals("")) {
- _lastErrorDescription = String.format("%s - %s", _lastErrorDescription, errDsc);
- } else {
- _lastErrorDescription = errDsc;
- }
- }
- }
-
- public X509Certificate getCertificate() {
- return _cert;
- }
-
- public boolean certLoaded() {
- return _cert != null;
- }
-
- public int getErrCode() {
-
- return _lastError;
-
- }
-
- public String getErrDescription() {
-
- return _lastErrorDescription;
-
- }
-}
diff --git a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXSigning.java b/gxcryptocommon/src/main/java/com/genexus/cryptography/GXSigning.java
deleted file mode 100644
index 3ed384b16..000000000
--- a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXSigning.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package com.genexus.cryptography;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.GeneralSecurityException;
-
-import org.apache.commons.codec.binary.Base64;
-import org.bouncycastle.cms.CMSException;
-
-import com.genexus.cryptography.exception.PrivateKeyNotFoundException;
-import com.genexus.cryptography.exception.PublicKeyNotFoundException;
-import com.genexus.cryptography.exception.SignatureException;
-import com.genexus.cryptography.signing.IPkcsSign;
-import com.genexus.cryptography.signing.standards.PKCS1Signature;
-import com.genexus.cryptography.signing.standards.PKCS7Signature;
-import com.genexus.cryptography.Utils.PKCSStandard;
-
-public class GXSigning {
-
- private GXCertificate _cert;
- private String _alg;
- private String _hashAlgorithm;
- private String _signAlgorithm;
- private IPkcsSign _sign;
- private int _lastError;
- private String _lastErrorDescription;
- private Boolean isDirty;
- private Boolean _validateCertificates;
- private PKCSStandard _standard;
-
- public GXSigning() {
- isDirty = true;
- _validateCertificates = true;
- _standard = Constants.DEFAULT_DIGITAL_SIGNATURE_STANDARD;
-
- _signAlgorithm = Constants.DEFAULT_DIGITAL_SIGNATURE_ALGORITHM_NAME;
- _hashAlgorithm = Constants.DEFAULT_DIGITAL_SIGNATURE_HASH_ALGORITHM_NAME;
- }
-
- public String sign(String text, Boolean detached) {
- Initialize();
- String signed = "";
- if (!anyError()) {
- try {
- _sign.setCertificate(_cert.getCertificate());
- if (_standard == PKCSStandard.PKCS7) {
- ((PKCS7Signature) _sign).setDetached(detached);
- }
- signed = _sign.sign(text.getBytes(Constants.UNICODE));
- } catch (PrivateKeyNotFoundException e) {
- setError(5);
- } catch (UnsupportedEncodingException e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- } catch (GeneralSecurityException e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- } catch (CMSException e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- } catch (IOException e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- } catch (PublicKeyNotFoundException e) {
- setError(4);
- }
- }
- return signed;
-
- }
-
- public Boolean verify(String signature, String text, Boolean detached) {
-
- Initialize();
- Boolean ok = false;
- if (!anyError()) {
- try {
- _sign.setCertificate(_cert.getCertificate());
- if (_standard == PKCSStandard.PKCS7) {
- ((PKCS7Signature) _sign).setDetached(detached);
- }
- ok = _sign.verify(text.getBytes(Constants.UNICODE), Base64.decodeBase64(signature));
- } catch (UnsupportedEncodingException e) {
- Utils.logError(e);
- setError(6);
- } catch (GeneralSecurityException e) {
- Utils.logError(e);
- setError(6);
- } catch (PublicKeyNotFoundException e) {
- setError(4);
- } catch (SignatureException e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- }
- }
- return ok;
-
- }
-
- private void Initialize() {
- if (isDirty) {
- String algorithm = String.format("%swith%s", _hashAlgorithm, _signAlgorithm);
- switch (_standard) {
- case PKCS1:
- _sign = new PKCS1Signature(algorithm, _cert.getCertificate(), _cert.getPrivateKey());
- break;
- case PKCS7:
- _sign = new PKCS7Signature(algorithm, _cert.getCertificate(), _cert.getPrivateKey());
- break;
- default:
- break;
- }
-
- isDirty = false;
- }
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = "";
- break;
- case 1:
- break;
- case 2:
- _lastErrorDescription = Constants.ALGORITHM_NOT_SUPPORTED;
- break;
- case 3:
- _lastErrorDescription = "Invalid Algorithm format";
- break;
- case 4:
- _lastErrorDescription = Constants.CERT_NOT_INITIALIZED;
- break;
- case 5:
- _lastErrorDescription = Constants.PRIVATEKEY_NOT_PRESENT;
- break;
- case 6:
- _lastErrorDescription = Constants.SIGNATURE_EXCEPTION;
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- if (!_lastErrorDescription.equals("")) {
- _lastErrorDescription = String.format("%s - %s", _lastErrorDescription, errDsc);
- } else {
- _lastErrorDescription = errDsc;
- }
- }
- }
-
- public void setValidateCertificate(Boolean validate) {
- this._validateCertificates = validate;
- }
-
- public Boolean getValidateCertificate() {
- return this._validateCertificates;
- }
-
- public void setStandard(String std) {
- PKCSStandard oldV = _standard;
- if (std.equals("PKCS7")) {
- _standard = PKCSStandard.PKCS7;
- } else if (std.equals("PKCS1")) {
- _standard = PKCSStandard.PKCS1;
- } else {
- setError(2); // Algorithm not supported
- }
-
- isDirty = isDirty || oldV != _standard;
- }
-
- public String getStandard() {
- return _standard.toString();
- }
-
- public void setAlgorithm(String value) {
-
- isDirty = isDirty || !value.equals(_alg);
- _alg = value;
- String[] parts = _alg.split(" ");
- if (parts.length == 2) // Format Example: MD5 RSA.
- {
- String hash = parts[0];
- String sign = parts[1];
-
- _hashAlgorithm = hash;
- _signAlgorithm = sign;
- } else {
- setError(3);
- // invalid format algorithm.
- }
-
- }
-
- public GXCertificate getCertificate() {
- return _cert;
- }
-
- public void setCertificate(GXCertificate cert) {
- this._cert = cert;
- }
-
- private Boolean anyError() {
-
- if (_cert == null || (_cert != null && !_cert.certLoaded())) {
- setError(4); // Certificate not initialized
- }
- return _lastError != 0;
- }
-
- public int getErrCode() {
-
- return _lastError;
-
- }
-
- public String getErrDescription() {
-
- return _lastErrorDescription;
-
- }
-}
diff --git a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXXMLDsig.java b/gxcryptocommon/src/main/java/com/genexus/cryptography/GXXMLDsig.java
deleted file mode 100644
index d09e969c7..000000000
--- a/gxcryptocommon/src/main/java/com/genexus/cryptography/GXXMLDsig.java
+++ /dev/null
@@ -1,344 +0,0 @@
-package com.genexus.cryptography;
-
-import java.io.ByteArrayOutputStream;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.cert.X509Certificate;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.xml.security.exceptions.XMLSecurityException;
-import org.apache.xml.security.keys.KeyInfo;
-import org.apache.xml.security.keys.content.X509Data;
-import org.apache.xml.security.signature.XMLSignature;
-import org.apache.xml.security.signature.XMLSignatureException;
-import org.apache.xml.security.transforms.Transforms;
-import org.apache.xml.security.utils.ElementProxy;
-import org.apache.xml.security.utils.XMLUtils;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.genexus.cryptography.signing.xml.Canonicalizer;
-import com.genexus.internet.StringCollection;
-
-public class GXXMLDsig {
-
- private PrivateKey _pKey;
- private X509Certificate _cert;
- private GXCertificate _gxCert;
-
- private List _references;
- private String _canonicalizationMethod;
- private boolean _detached;
- private StringCollection _keyInfoClauses;
- private int _lastError;
- private String _lastErrorDescription;
- private boolean _validateCertificate;
-
- public GXXMLDsig() {
- _references = new ArrayList();
- _keyInfoClauses = new StringCollection() {
- {
- add("X509IssuerSerial");
- add("X509SubjectName");
- add("X509Certificate");
- }
- };
- _canonicalizationMethod = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
- _detached = false;
- }
-
- private void initialize() {
- setError(0);
- }
-
- public void addReference(String reference) {
- _references.add(reference);
- }
-
- public String sign(String xml) {
- return signElements(xml, "");
- }
-
- public String signElements(String xml, String xPath) {
- initialize();
- if (!anyError()) {
- if (!_gxCert.hasPrivateKey())
- {
- setError(5);
- return "";
- }
- try {
-
- Document doc = Utils.documentFromString(Canonicalizer.canonize(xml), true);
- if (doc == null) {
- setError(2);
- return "";
- }
- ArrayList list = new ArrayList();
-
- if (xPath.equals("")) {
- list.add(doc.getDocumentElement());
- } else {
- XPath xPathHelper = XPathFactory.newInstance().newXPath();
- NodeList nodeList = (NodeList) xPathHelper.evaluate(xPath, doc, XPathConstants.NODESET);
- for (int i = 0; i < nodeList.getLength(); i++) {
- list.add((Element) nodeList.item(i));
- }
- }
-
- for (int i = 0; i < list.size(); i++) {
-
- Element element = (Element) list.get(i);
-
- // Create a DOM XMLSignatureFactory that will be used to
- // generate the enveloped signature.
-
- // removes signature element if present.
- NodeList nodeListSignature = element.getElementsByTagName("Signature");
- for (int j = 0; j < nodeListSignature.getLength(); j++) {
- Node parentSignature = nodeListSignature.item(j).getParentNode();
- parentSignature.removeChild(nodeListSignature.item(j));
- }
-
- DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
- Document docToBeSigned = docBuilder.newDocument();
-
- docToBeSigned.appendChild(docToBeSigned.importNode(element, true));
-
- ElementProxy.setDefaultPrefix(org.apache.xml.security.utils.Constants.SignatureSpecNS, "");
-
- XMLSignature signature = new XMLSignature(docToBeSigned, "",
- XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1);
-
- docToBeSigned.getDocumentElement().appendChild(signature.getElement());
- Transforms transforms = new Transforms(docToBeSigned);
- transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
-
- if (_references.size() > 0) {
- for (int j = 0; j < _references.size(); j++) {
- signature.addDocument(_references.get(j), transforms,
- org.apache.xml.security.utils.Constants.ALGO_ID_DIGEST_SHA1);
- }
- } else {
- signature.addDocument("", transforms,
- org.apache.xml.security.utils.Constants.ALGO_ID_DIGEST_SHA1); // Signs
- // the
- // whole
- // document
- }
-
- setKeyInfo(signature);
-
- signature.sign(_gxCert.getPrivateKey());
-
- Node p = element.getParentNode();
- p.replaceChild(doc.importNode(docToBeSigned.getDocumentElement(), true), element);
- }
- ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
- XMLUtils.outputDOMc14nWithComments(doc, byteArray);
- return new String(byteArray.toByteArray());
-
- } catch (NoSuchAlgorithmException e) {
- Utils.logError(e);
- setError(3);
- } catch (InvalidAlgorithmParameterException e) {
- Utils.logError(e);
- } catch (Exception e) {
- Utils.logError(e);
- setError(6, e.getMessage());
- }
- }
- return "";
- }
-
- public boolean verify(String xml) {
- initialize();
- Document doc = null;
- try {
- doc = Utils.documentFromString(Canonicalizer.canonize(xml), true);
-
- } catch (Exception e) {
- }
-
- if (doc == null) {
- setError(2);
- return false;
- }
-
- // Find Signature element.
- NodeList nl = doc.getElementsByTagNameNS("http://www.w3.org/2000/09/xmldsig#", "Signature");
- if (nl.getLength() == 0) {
- return false;
- }
-
- try {
- Element sigElement = (Element) nl.item(0);
- XMLSignature signature = new XMLSignature(sigElement, "");
-
- boolean certValid = true;
- if (_validateCertificate) {
- certValid = _gxCert.verify();
- if (!certValid) {
- setError(7);
- }
- }
- KeyInfo ki = signature.getKeyInfo();
- boolean valid = true;
- if (ki == null) {
- setError(8);
- }
-
- X509Certificate cert = signature.getKeyInfo().getX509Certificate();
- if (cert == null) {
- PublicKey pk = signature.getKeyInfo().getPublicKey();
- if (pk == null) {
- setError(7);
- }
- valid = signature.checkSignatureValue(pk);
- } else {
- valid = signature.checkSignatureValue(cert);
- }
- if (!valid) {
- setError(9);
- }
- return valid && certValid;
- } catch (XMLSignatureException e) {
- Utils.logError(e);
- setError(6);
- } catch (XMLSecurityException e) {
- Utils.logError(e);
- setError(6);
- }
- return false;
- }
-
- private void setKeyInfo(XMLSignature signature) {
- X509Data x509data = new X509Data(signature.getDocument());
- if (_keyInfoClauses.getCount() > 0) {
- List
-
- ${project.groupId}
- gxcryptocommon
- ${project.version}
-
+
${project.groupId}
gxmail
diff --git a/java/src/main/java/com/genexus/cryptography/GXAsymEncryption.java b/java/src/main/java/com/genexus/cryptography/GXAsymEncryption.java
deleted file mode 100644
index 52389e8e9..000000000
--- a/java/src/main/java/com/genexus/cryptography/GXAsymEncryption.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package com.genexus.cryptography;
-
-import com.genexus.cryptography.encryption.asymmetric.CipherAsymProvider;
-import com.genexus.cryptography.encryption.asymmetric.IGXAsymEncryption;
-import com.genexus.cryptography.exception.AlgorithmNotSupportedException;
-import com.genexus.cryptography.exception.EncryptionException;
-import com.genexus.cryptography.exception.PrivateKeyNotFoundException;
-import com.genexus.cryptography.exception.PublicKeyNotFoundException;
-
-public class GXAsymEncryption {
-
- private static final String DEFAULT_SYM_ALGORITHM = "RSA";
- private static final String DEFAULT_SYM_PADDING = "PKCS1Padding";
- private static final String DEFAULT_SYM_MODE = "ECB";
-
- private int _lastError;
- private String _lastErrorDescription;
- private String _algorithm;
-
- private GXCertificate _cert;
- private IGXAsymEncryption _asymAlg;
- private boolean _isDirty;
-
- public GXAsymEncryption() {
- _isDirty = true;
- _algorithm = String.format("%s/%s/%s", DEFAULT_SYM_ALGORITHM,
- DEFAULT_SYM_MODE, DEFAULT_SYM_PADDING);
- initialize();
- }
-
- private void initialize() {
- if (_isDirty) {
- // Support algorithms = RSA only for now..
- setError(0);
-
- if (_cert != null && _cert.certLoaded() == true) {
- try {
- _asymAlg = new CipherAsymProvider(_algorithm,
- _cert.getPublicKey(), _cert.getPrivateKey());
- _isDirty = false;
- } catch (AlgorithmNotSupportedException e) {
- setError(2);
- }
- } else {
- setError(4);
- }
- }
- }
-
- public String encrypt(String text) {
- initialize();
- String encrypted = "";
- if (!anyError()) {
- try {
- encrypted = _asymAlg.encrypt(text);
- } catch (PublicKeyNotFoundException e) {
- setError(4);
- } catch (EncryptionException e) {
- setError(3);
- Utils.logError(e);
- }
- }
- return encrypted;
- }
-
- public String decrypt(String text) {
- initialize();
- String decrypted = "";
- if (!anyError()) {
-
- try {
- decrypted = _asymAlg.decrypt(text);
- } catch (PrivateKeyNotFoundException e) {
- setError(5);
- } catch (EncryptionException e) {
- setError(3);
- Utils.logError(e);
- }
- }
- return decrypted;
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = Constants.OK;
- break;
- case 1:
- break;
- case 2:
- _lastErrorDescription = Constants.ALGORITHM_NOT_SUPPORTED;
- break;
- case 3:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 4:
- _lastErrorDescription = "";
- break;
- case 5:
- _lastErrorDescription = Constants.PRIVATEKEY_NOT_PRESENT;
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- _lastErrorDescription = errDsc;
- }
- }
-
- public String getAlgorithm() {
- return _algorithm;
- }
-
- public void setAlgorithm(String value) {
- value = String.format("%s/%s/%s", value, DEFAULT_SYM_MODE,
- DEFAULT_SYM_PADDING);
- _isDirty = _isDirty || !value.equals(_algorithm);
- _algorithm = value;
- }
-
- public GXCertificate getCertificate() {
- return _cert;
-
- }
-
- public void setCertificate(GXCertificate cert) {
- _isDirty = _isDirty || cert != _cert;
- _cert = cert;
- }
-
- private boolean anyError() {
-
- if (_cert == null || (!_cert.certLoaded() == true)) {
- setError(4); // Certificate not initialized
- }
- return _lastError != 0;
-
- }
-
- public int getErrCode() {
- return _lastError;
- }
-
- public String getErrDescription() {
- return _lastErrorDescription;
- }
-}
diff --git a/java/src/main/java/com/genexus/cryptography/GXSymEncryption.java b/java/src/main/java/com/genexus/cryptography/GXSymEncryption.java
deleted file mode 100644
index 4d862353a..000000000
--- a/java/src/main/java/com/genexus/cryptography/GXSymEncryption.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package com.genexus.cryptography;
-
-import java.security.NoSuchAlgorithmException;
-
-import javax.crypto.NoSuchPaddingException;
-
-import com.genexus.diagnostics.Log;
-
-import com.genexus.cryptography.encryption.symmetric.CipherSymProvider;
-import com.genexus.cryptography.encryption.symmetric.IGXSymEncryption;
-import com.genexus.cryptography.exception.AlgorithmNotSupportedException;
-import com.genexus.cryptography.exception.EncryptionException;
-import com.genexus.cryptography.exception.InvalidKeyLengthException;
-
-public class GXSymEncryption {
-
- private int _lastError;
- private String _lastErrorDescription;
- private IGXSymEncryption _symAlg; // Algorithm instance
- private String _algorithm;
- private String _key = ""; // key
- private String _iv = ""; // initialization vector
- private boolean isDirty;
- private int _keySize;
- private int _blockSize;
-
- public GXSymEncryption() {
- isDirty = true;
- _algorithm = String.format("%s/%s/%s", Constants.DEFAULT_SYM_ALGORITHM, Constants.DEFAULT_SYM_MODE,
- Constants.DEFAULT_SYM_PADDING);
- }
-
- private void Initialize() {
- if (isDirty) {
- // Supported algorithms = {Rijndael, DES, RC2, TripleDES}
- setError(0);
-
- try {
- _symAlg = new CipherSymProvider(_algorithm);
- if (validPropertyValue(_key)) {
- _symAlg.setKey(_key);
- }
- if (validPropertyValue(_iv)) {
- _symAlg.setIV(_iv);
- }
- if (_blockSize > 0) {
- _symAlg.setBlockSize(_blockSize);
- }
- if (_keySize > 0) {
- _symAlg.setKeySize(_keySize);
- }
- isDirty = false;
- } catch (NoSuchAlgorithmException e) {
- setError(2);
- logError(e);
- } catch (NoSuchPaddingException e) {
- setError(3);
- logError(e);
- } catch (InvalidKeyLengthException e) {
- setError(4, e.getMessage());
- logError(e);
- } catch (AlgorithmNotSupportedException e) {
- setError(2);
- logError(e);
- }
- }
- }
-
- private boolean validPropertyValue(String value) {
- return value != null && !value.equals("");
- }
-
- public String encrypt(String text) {
- Initialize();
- String encrypted = "";
- if (!anyError()) {
- try {
- encrypted = _symAlg.encrypt(text);
- } catch (EncryptionException e) {
- setError(1);
- Log.error(e.getMessage(), "GXSymEncryption", e);
- }
- }
- return encrypted;
- }
-
- public String decrypt(String text) {
- Initialize();
- String decrypted = "";
- if (!anyError()) {
- try {
- if (getIV().equals("")){
- setError(5);
- return "";
- }
- decrypted = _symAlg.decrypt(text);
- } catch (EncryptionException e) {
- setError(1);
- logError(e);
- }
- }
- return decrypted;
- }
-
- public String getAlgorithm() {
- return _algorithm;
- }
-
- public void setAlgorithm(String algorithm) {
- algorithm = String.format("%s/%s/%s", algorithm, Constants.DEFAULT_SYM_MODE, Constants.DEFAULT_SYM_PADDING);
- isDirty = isDirty || !this._algorithm.equals(algorithm);
- this._algorithm = algorithm;
- }
-
- public String getKey() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getKey();
- return _key;
- }
-
- public void setKey(String key) {
- isDirty = isDirty || !this._key.equals(key);
- this._key = key;
- }
-
- public String getIV() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getIV();
- return _iv;
- }
-
- public void setIV(String iv) {
- isDirty = isDirty || !this._iv.equals(iv);
- this._iv = iv;
- }
-
- public int getKeySize() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getKeySize();
- return _keySize;
- }
-
- public void setKeySize(int keySize) {
- isDirty = isDirty || this._keySize != keySize;
- this._keySize = keySize;
-
- }
-
- public int getBlockSize() {
- if (!anyError() && _symAlg != null)
- return _symAlg.getBlockSize();
- return _blockSize;
- }
-
- public void setBlockSize(int blockSize) {
- isDirty = isDirty || this._blockSize != blockSize;
- this._blockSize = blockSize;
- }
-
- private void setError(int errorCode) {
- setError(errorCode, "");
- }
-
- private void setError(int errorCode, String errDsc) {
- _lastError = errorCode;
- switch (errorCode) {
- case 0:
- _lastErrorDescription = "";
- break;
- case 1:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 2:
- _lastErrorDescription = Constants.ALGORITHM_NOT_SUPPORTED;
- break;
- case 3:
- _lastErrorDescription = Constants.ENCRYPTION_ERROR;
- break;
- case 4:
- _lastErrorDescription = Constants.KEY_NOT_VALID;
- break;
- case 5:
- _lastErrorDescription = "IV must be set for Decryption";
- break;
- default:
- break;
- }
- if (!errDsc.equals("")) {
- _lastErrorDescription = errDsc;
- }
- }
-
- private boolean anyError() {
- return _lastError != 0;
- }
-
- public int getErrCode() {
- return _lastError;
- }
-
- public String getErrDescription() {
- return _lastErrorDescription;
- }
-
- private static void logError(Throwable e) {
- Log.error(e.getMessage(), "GXSymEncryption", e);
- }
-}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7a9973d0b..d81fb0724 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,7 +87,6 @@
wrapperjakarta
wrappercommon
java
- gxcryptocommon
gxdynamiccall
gxmail
gxmaps