added file decryption, rewrote the various "Choice" derivations to us the Id structure as well
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user