aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
index 3c3bcc890..c2fa811bd 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java
@@ -81,6 +81,7 @@ public class PgpSignEncrypt extends BaseOperation {
private boolean mCleartextInput;
private String mOriginalFilename;
private boolean mFailOnMissingEncryptionKeyIds;
+ private String mCharset;
private byte[] mNfcSignedHash = null;
private Date mNfcCreationTimestamp = null;
@@ -118,6 +119,7 @@ public class PgpSignEncrypt extends BaseOperation {
this.mNfcCreationTimestamp = builder.mNfcCreationTimestamp;
this.mOriginalFilename = builder.mOriginalFilename;
this.mFailOnMissingEncryptionKeyIds = builder.mFailOnMissingEncryptionKeyIds;
+ this.mCharset = builder.mCharset;
}
public static class Builder {
@@ -145,6 +147,7 @@ public class PgpSignEncrypt extends BaseOperation {
private byte[] mNfcSignedHash = null;
private Date mNfcCreationTimestamp = null;
private boolean mFailOnMissingEncryptionKeyIds = false;
+ private String mCharset = null;
public Builder(Context context, ProviderHelper providerHelper, Progressable progressable,
InputData data, OutputStream outStream) {
@@ -211,6 +214,11 @@ public class PgpSignEncrypt extends BaseOperation {
return this;
}
+ public Builder setCharset(String charset) {
+ mCharset = charset;
+ return this;
+ }
+
/**
* Also encrypt with the signing keyring
*
@@ -283,6 +291,10 @@ public class PgpSignEncrypt extends BaseOperation {
if (mVersionHeader != null) {
armorOut.setHeader("Version", mVersionHeader);
}
+ // if we have a charset, put it in the header
+ if (mCharset != null) {
+ armorOut.setHeader("Charset", mCharset);
+ }
out = armorOut;
} else {
out = mOutStream;