mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-19 20:31:52 -05:00
Rename setter methods for PgpSignEncrypt.Builder
This commit is contained in:
parent
9e6bf2abbb
commit
324971e448
@ -141,53 +141,53 @@ public class PgpSignEncrypt {
|
|||||||
this.mOutStream = outStream;
|
this.mOutStream = outStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder progressable(Progressable progressable) {
|
public Builder setProgressable(Progressable progressable) {
|
||||||
this.mProgressable = progressable;
|
mProgressable = progressable;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder enableAsciiArmorOutput(boolean enableAsciiArmorOutput) {
|
public Builder setEnableAsciiArmorOutput(boolean enableAsciiArmorOutput) {
|
||||||
this.mEnableAsciiArmorOutput = enableAsciiArmorOutput;
|
mEnableAsciiArmorOutput = enableAsciiArmorOutput;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder compressionId(int compressionId) {
|
public Builder setCompressionId(int compressionId) {
|
||||||
this.mCompressionId = compressionId;
|
mCompressionId = compressionId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder encryptionMasterKeyIds(long[] encryptionMasterKeyIds) {
|
public Builder setEncryptionMasterKeyIds(long[] encryptionMasterKeyIds) {
|
||||||
this.mEncryptionMasterKeyIds = encryptionMasterKeyIds;
|
this.mEncryptionMasterKeyIds = encryptionMasterKeyIds;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder symmetricPassphrase(String symmetricPassphrase) {
|
public Builder setSymmetricPassphrase(String symmetricPassphrase) {
|
||||||
this.mSymmetricPassphrase = symmetricPassphrase;
|
this.mSymmetricPassphrase = symmetricPassphrase;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder symmetricEncryptionAlgorithm(int symmetricEncryptionAlgorithm) {
|
public Builder setSymmetricEncryptionAlgorithm(int symmetricEncryptionAlgorithm) {
|
||||||
this.mSymmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm;
|
mSymmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder signatureMasterKeyId(long signatureMasterKeyId) {
|
public Builder setSignatureMasterKeyId(long signatureMasterKeyId) {
|
||||||
this.mSignatureMasterKeyId = signatureMasterKeyId;
|
this.mSignatureMasterKeyId = signatureMasterKeyId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder signatureHashAlgorithm(int signatureHashAlgorithm) {
|
public Builder setSignatureHashAlgorithm(int signatureHashAlgorithm) {
|
||||||
this.mSignatureHashAlgorithm = signatureHashAlgorithm;
|
mSignatureHashAlgorithm = signatureHashAlgorithm;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder signatureForceV3(boolean signatureForceV3) {
|
public Builder setSignatureForceV3(boolean signatureForceV3) {
|
||||||
this.mSignatureForceV3 = signatureForceV3;
|
mSignatureForceV3 = signatureForceV3;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder signaturePassphrase(String signaturePassphrase) {
|
public Builder setSignaturePassphrase(String signaturePassphrase) {
|
||||||
this.mSignaturePassphrase = signaturePassphrase;
|
mSignaturePassphrase = signaturePassphrase;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ public class PgpSignEncrypt {
|
|||||||
* @param encryptToSigner
|
* @param encryptToSigner
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Builder encryptToSigner(boolean encryptToSigner) {
|
public Builder setEncryptToSigner(boolean encryptToSigner) {
|
||||||
this.mEncryptToSigner = encryptToSigner;
|
this.mEncryptToSigner = encryptToSigner;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ public class PgpSignEncrypt {
|
|||||||
* @param cleartextInput
|
* @param cleartextInput
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Builder cleartextInput(boolean cleartextInput) {
|
public Builder setCleartextInput(boolean cleartextInput) {
|
||||||
this.mCleartextInput = cleartextInput;
|
this.mCleartextInput = cleartextInput;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -170,14 +170,14 @@ public class OpenPgpService extends RemoteService {
|
|||||||
new ProviderHelper(getContext()),
|
new ProviderHelper(getContext()),
|
||||||
PgpHelper.getFullVersion(getContext()),
|
PgpHelper.getFullVersion(getContext()),
|
||||||
inputData, os);
|
inputData, os);
|
||||||
builder.enableAsciiArmorOutput(asciiArmor)
|
builder.setEnableAsciiArmorOutput(asciiArmor)
|
||||||
.signatureHashAlgorithm(accSettings.getHashAlgorithm())
|
.setSignatureHashAlgorithm(accSettings.getHashAlgorithm())
|
||||||
.signatureForceV3(false)
|
.setSignatureForceV3(false)
|
||||||
.signatureMasterKeyId(accSettings.getKeyId())
|
.setSignatureMasterKeyId(accSettings.getKeyId())
|
||||||
.signaturePassphrase(passphrase);
|
.setSignaturePassphrase(passphrase);
|
||||||
|
|
||||||
// TODO: currently always assume cleartext input, no sign-only of binary currently!
|
// TODO: currently always assume cleartext input, no sign-only of binary currently!
|
||||||
builder.cleartextInput(true);
|
builder.setCleartextInput(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
builder.build().execute();
|
builder.build().execute();
|
||||||
@ -254,10 +254,10 @@ public class OpenPgpService extends RemoteService {
|
|||||||
new ProviderHelper(getContext()),
|
new ProviderHelper(getContext()),
|
||||||
PgpHelper.getFullVersion(getContext()),
|
PgpHelper.getFullVersion(getContext()),
|
||||||
inputData, os);
|
inputData, os);
|
||||||
builder.enableAsciiArmorOutput(asciiArmor)
|
builder.setEnableAsciiArmorOutput(asciiArmor)
|
||||||
.compressionId(accSettings.getCompression())
|
.setCompressionId(accSettings.getCompression())
|
||||||
.symmetricEncryptionAlgorithm(accSettings.getEncryptionAlgorithm())
|
.setSymmetricEncryptionAlgorithm(accSettings.getEncryptionAlgorithm())
|
||||||
.encryptionMasterKeyIds(keyIds);
|
.setEncryptionMasterKeyIds(keyIds);
|
||||||
|
|
||||||
if (sign) {
|
if (sign) {
|
||||||
String passphrase;
|
String passphrase;
|
||||||
@ -274,13 +274,13 @@ public class OpenPgpService extends RemoteService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sign and encrypt
|
// sign and encrypt
|
||||||
builder.signatureHashAlgorithm(accSettings.getHashAlgorithm())
|
builder.setSignatureHashAlgorithm(accSettings.getHashAlgorithm())
|
||||||
.signatureForceV3(false)
|
.setSignatureForceV3(false)
|
||||||
.signatureMasterKeyId(accSettings.getKeyId())
|
.setSignatureMasterKeyId(accSettings.getKeyId())
|
||||||
.signaturePassphrase(passphrase);
|
.setSignaturePassphrase(passphrase);
|
||||||
} else {
|
} else {
|
||||||
// encrypt only
|
// encrypt only
|
||||||
builder.signatureMasterKeyId(Constants.key.none);
|
builder.setSignatureMasterKeyId(Constants.key.none);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -313,24 +313,24 @@ public class KeychainIntentService extends IntentService
|
|||||||
new ProviderHelper(this),
|
new ProviderHelper(this),
|
||||||
PgpHelper.getFullVersion(this),
|
PgpHelper.getFullVersion(this),
|
||||||
inputData, outStream);
|
inputData, outStream);
|
||||||
builder.progressable(this);
|
builder.setProgressable(this);
|
||||||
|
|
||||||
builder.enableAsciiArmorOutput(useAsciiArmor)
|
builder.setEnableAsciiArmorOutput(useAsciiArmor)
|
||||||
.compressionId(compressionId)
|
.setCompressionId(compressionId)
|
||||||
.symmetricEncryptionAlgorithm(
|
.setSymmetricEncryptionAlgorithm(
|
||||||
Preferences.getPreferences(this).getDefaultEncryptionAlgorithm())
|
Preferences.getPreferences(this).getDefaultEncryptionAlgorithm())
|
||||||
.signatureForceV3(Preferences.getPreferences(this).getForceV3Signatures())
|
.setSignatureForceV3(Preferences.getPreferences(this).getForceV3Signatures())
|
||||||
.encryptionMasterKeyIds(encryptionKeyIds)
|
.setEncryptionMasterKeyIds(encryptionKeyIds)
|
||||||
.symmetricPassphrase(symmetricPassphrase)
|
.setSymmetricPassphrase(symmetricPassphrase)
|
||||||
.signatureMasterKeyId(signatureKeyId)
|
.setSignatureMasterKeyId(signatureKeyId)
|
||||||
.signatureHashAlgorithm(
|
.setSignatureHashAlgorithm(
|
||||||
Preferences.getPreferences(this).getDefaultHashAlgorithm())
|
Preferences.getPreferences(this).getDefaultHashAlgorithm())
|
||||||
.signaturePassphrase(
|
.setSignaturePassphrase(
|
||||||
PassphraseCacheService.getCachedPassphrase(this, signatureKeyId));
|
PassphraseCacheService.getCachedPassphrase(this, signatureKeyId));
|
||||||
|
|
||||||
// this assumes that the bytes are cleartext (valid for current implementation!)
|
// this assumes that the bytes are cleartext (valid for current implementation!)
|
||||||
if (target == TARGET_BYTES) {
|
if (target == TARGET_BYTES) {
|
||||||
builder.cleartextInput(true);
|
builder.setCleartextInput(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.build().execute();
|
builder.build().execute();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user