Support Passphrase-Format and -Begin headers in PgpSignEncryptOperation
This commit is contained in:
@@ -61,6 +61,11 @@ public abstract class PgpSignEncryptData implements Parcelable {
|
|||||||
public abstract boolean isAddBackupHeader();
|
public abstract boolean isAddBackupHeader();
|
||||||
public abstract boolean isHiddenRecipients();
|
public abstract boolean isHiddenRecipients();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public abstract String getPassphraseFormat();
|
||||||
|
@Nullable
|
||||||
|
public abstract String getPassphraseBegin();
|
||||||
|
|
||||||
public static Builder builder() {
|
public static Builder builder() {
|
||||||
return new AutoValue_PgpSignEncryptData.Builder()
|
return new AutoValue_PgpSignEncryptData.Builder()
|
||||||
.setSignatureMasterKeyId(Constants.key.none)
|
.setSignatureMasterKeyId(Constants.key.none)
|
||||||
@@ -102,6 +107,9 @@ public abstract class PgpSignEncryptData implements Parcelable {
|
|||||||
setAllowedSigningKeyIds(Collections.unmodifiableList(new ArrayList<>(allowedSigningKeyIds)));
|
setAllowedSigningKeyIds(Collections.unmodifiableList(new ArrayList<>(allowedSigningKeyIds)));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract Builder setPassphraseFormat(String passphraseFormat);
|
||||||
|
public abstract Builder setPassphraseBegin(String passphraseBegin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,6 +206,14 @@ public class PgpSignEncryptOperation extends BaseOperation<PgpSignEncryptInputPa
|
|||||||
if (data.isAddBackupHeader()) {
|
if (data.isAddBackupHeader()) {
|
||||||
armorOut.setHeader("BackupVersion", "2");
|
armorOut.setHeader("BackupVersion", "2");
|
||||||
}
|
}
|
||||||
|
String passphraseFormat = data.getPassphraseFormat();
|
||||||
|
if (passphraseFormat != null) {
|
||||||
|
armorOut.setHeader("Passphrase-Format", passphraseFormat);
|
||||||
|
}
|
||||||
|
String passphraseBegin = data.getPassphraseBegin();
|
||||||
|
if (passphraseBegin != null) {
|
||||||
|
armorOut.setHeader("Passphrase-Begin", passphraseBegin);
|
||||||
|
}
|
||||||
out = armorOut;
|
out = armorOut;
|
||||||
} else {
|
} else {
|
||||||
out = outputStream;
|
out = outputStream;
|
||||||
|
|||||||
Reference in New Issue
Block a user