forgot a thing for secret key export

This commit is contained in:
Vincent Breitmoser 2014-10-30 15:10:20 +01:00
parent a221464f38
commit 7017527999
1 changed files with 24 additions and 18 deletions

View File

@ -458,6 +458,7 @@ public class ImportExportOperation extends BaseOperation {
// Create an output stream
ArmoredOutputStream arOutStream = new ArmoredOutputStream(outStream);
try {
String version = PgpHelper.getVersionForHeader(mContext);
if (version != null) {
arOutStream.setHeader("Version", version);
@ -470,7 +471,6 @@ public class ImportExportOperation extends BaseOperation {
{ // export public key part
byte[] data = cursor.getBlob(1);
arOutStream.write(data);
arOutStream.close();
okPublic += 1;
}
@ -483,6 +483,12 @@ public class ImportExportOperation extends BaseOperation {
okSecret += 1;
}
} finally {
// make sure this is closed
if (arOutStream != null) {
arOutStream.close();
}
}
updateProgress(progress++, numKeys);