X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FConfirmation.java;fp=src%2Forg%2Fibex%2Fmail%2FConfirmation.java;h=9bf7804691f811b0c57ea430360a08a962633fb2;hb=b3da176ccd1a173a99f80cb0843b76ca78745c2a;hp=c19733746c48af39a75807405f04ab75926b4287;hpb=ed57cea77aa4eeff473a7dc0a01f3ab989a43545;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/Confirmation.java b/src/org/ibex/mail/Confirmation.java index c197337..9bf7804 100644 --- a/src/org/ibex/mail/Confirmation.java +++ b/src/org/ibex/mail/Confirmation.java @@ -105,20 +105,20 @@ public abstract class Confirmation implements Externalizable { oos.flush(); oos.close(); byte[] b = os.toByteArray(); - StringBuffer sb = new StringBuffer(new String(Base64.encode(b))); + StringBuffer sb = new StringBuffer(new String(Encode.toBase64(b))); sb.append('.'); SHA1 sha1 = new SHA1(); sha1.update(b, 0, b.length); b = new byte[sha1.getDigestSize()]; sha1.doFinal(b, 0); - sb.append(new String(Base64.encode(b))); + sb.append(new String(Encode.toBase64(b))); return sb.toString(); } public static Confirmation decode(String encoded, long secret, Date now) { try { String payload = encoded.substring(0, encoded.indexOf('.')); - ObjectInputStream ois = new ObjectInputStream(new InflaterInputStream(new Base64.InputStream(payload))); + ObjectInputStream ois = new ObjectInputStream(new InflaterInputStream(new Encode.Base64InputStream(payload))); Confirmation cve = (Confirmation)ois.readObject(); if (!cve.sign(secret).equals(encoded)) throw new InvalidSignature(); if (now.getTime() > cve.expiration) throw new Expired();