added file decryption, rewrote the various "Choice" derivations to us the Id structure as well

This commit is contained in:
Thialfihar
2010-04-22 15:30:19 +00:00
parent 26cf672d67
commit 78193007b2
10 changed files with 537 additions and 94 deletions

View File

@@ -16,6 +16,7 @@
package org.thialfihar.android.apg;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -267,7 +268,7 @@ public class EncryptFileActivity extends BaseActivity {
}
InputStream in = new FileInputStream(mInputFilename);
OutputStream out = new FileOutputStream(mOutputFilename);
ByteArrayOutputStream out = new ByteArrayOutputStream();
if (mTabHost.getCurrentTabTag().equals(TAB_ASYMMETRIC)) {
boolean encryptIt = mEncryptionKeyIds != null && mEncryptionKeyIds.length > 0;
@@ -284,6 +285,9 @@ public class EncryptFileActivity extends BaseActivity {
}
out.close();
OutputStream fileOut = new FileOutputStream(mOutputFilename);
fileOut.write(out.toByteArray());
fileOut.close();
} catch (FileNotFoundException e) {
error = "file not found: " + e.getMessage();
}