X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Futil%2Fsecurity%2FPasswordBasedEncryption.java;h=fcc5f8319c89204c072f97e1fe5407ab39bc5cda;hb=3a0d866fbeea3f78c293212f4b4fbaeba7dfe2bd;hp=d7866a810255992040f300373a643baf1d46b028;hpb=0a7d938324d33848ac7dc4ef4007c73a714171ee;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/util/security/PasswordBasedEncryption.java b/org.argeo.util/src/org/argeo/util/security/PasswordBasedEncryption.java index d7866a810..fcc5f8319 100644 --- a/org.argeo.util/src/org/argeo/util/security/PasswordBasedEncryption.java +++ b/org.argeo.util/src/org/argeo/util/security/PasswordBasedEncryption.java @@ -33,8 +33,8 @@ import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.SecretKeySpec; -import org.argeo.ArgeoException; -import org.argeo.StreamUtils; +import org.argeo.util.internal.UtilsException; +import org.argeo.util.internal.StreamUtils; /** Simple password based encryption / decryption */ public class PasswordBasedEncryption { @@ -92,11 +92,11 @@ public class PasswordBasedEncryption { try { initKeyAndCiphers(password, passwordSalt, initializationVector); } catch (Exception e1) { - throw new ArgeoException( + throw new UtilsException( "Cannot get secret key (with restricted length)", e1); } } catch (Exception e) { - throw new ArgeoException("Cannot get secret key", e); + throw new UtilsException("Cannot get secret key", e); } } @@ -139,7 +139,7 @@ public class PasswordBasedEncryption { } catch (IOException e) { throw e; } catch (Exception e) { - throw new ArgeoException("Cannot encrypt", e); + throw new UtilsException("Cannot encrypt", e); } finally { StreamUtils.closeQuietly(decryptedIn); } @@ -154,7 +154,7 @@ public class PasswordBasedEncryption { } catch (IOException e) { throw e; } catch (Exception e) { - throw new ArgeoException("Cannot decrypt", e); + throw new UtilsException("Cannot decrypt", e); } finally { StreamUtils.closeQuietly(encryptedIn); } @@ -169,7 +169,7 @@ public class PasswordBasedEncryption { encrypt(in, out); return out.toByteArray(); } catch (Exception e) { - throw new ArgeoException("Cannot encrypt", e); + throw new UtilsException("Cannot encrypt", e); } finally { StreamUtils.closeQuietly(out); } @@ -183,7 +183,7 @@ public class PasswordBasedEncryption { decrypt(in, out); return new String(out.toByteArray(), DEFAULT_CHARSET); } catch (Exception e) { - throw new ArgeoException("Cannot decrypt", e); + throw new UtilsException("Cannot decrypt", e); } finally { StreamUtils.closeQuietly(out); }