updated for new org.ibex.js
[org.ibex.mail.git] / src / org / ibex / mail / Confirmation.java
index c197337..9bf7804 100644 (file)
@@ -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();