diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-04-29 19:51:21 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-04-29 19:51:21 +0200 |
commit | e0a0bf04ee6fa4794a82b44dae905bc814d85491 (patch) | |
tree | 60d2d7c10368e094e5940fcd299bb4ffee60c3aa /OpenKeychain/src/main/java/org | |
parent | 5c145cf44decbdb686673a49e28310b6811931f2 (diff) | |
parent | 1f7c61a33140ac2319766d5f193beddaa789b7d3 (diff) | |
download | open-keychain-e0a0bf04ee6fa4794a82b44dae905bc814d85491.tar.gz open-keychain-e0a0bf04ee6fa4794a82b44dae905bc814d85491.tar.bz2 open-keychain-e0a0bf04ee6fa4794a82b44dae905bc814d85491.zip |
Merge pull request #601 from thi/rename-builder-methods
Rename builder methods
Diffstat (limited to 'OpenKeychain/src/main/java/org')
4 files changed, 58 insertions, 58 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java index 71900d002..506c161ba 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpDecryptVerify.java @@ -118,18 +118,18 @@ public class PgpDecryptVerify { this.mOutStream = outStream; } - public Builder progressable(Progressable progressable) { - this.mProgressable = progressable; + public Builder setProgressable(Progressable progressable) { + mProgressable = progressable; return this; } - public Builder allowSymmetricDecryption(boolean allowSymmetricDecryption) { - this.mAllowSymmetricDecryption = allowSymmetricDecryption; + public Builder setAllowSymmetricDecryption(boolean allowSymmetricDecryption) { + mAllowSymmetricDecryption = allowSymmetricDecryption; return this; } - public Builder passphrase(String passphrase) { - this.mPassphrase = passphrase; + public Builder setPassphrase(String passphrase) { + mPassphrase = passphrase; return this; } @@ -140,7 +140,7 @@ public class PgpDecryptVerify { * @param allowedKeyIds * @return */ - public Builder allowedKeyIds(Set<Long> allowedKeyIds) { + public Builder setAllowedKeyIds(Set<Long> allowedKeyIds) { this.mAllowedKeyIds = allowedKeyIds; return this; } 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 4b1ecc0f1..30cac9b77 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpSignEncrypt.java @@ -141,53 +141,53 @@ public class PgpSignEncrypt { this.mOutStream = outStream; } - public Builder progressable(Progressable progressable) { - this.mProgressable = progressable; + public Builder setProgressable(Progressable progressable) { + mProgressable = progressable; return this; } - public Builder enableAsciiArmorOutput(boolean enableAsciiArmorOutput) { - this.mEnableAsciiArmorOutput = enableAsciiArmorOutput; + public Builder setEnableAsciiArmorOutput(boolean enableAsciiArmorOutput) { + mEnableAsciiArmorOutput = enableAsciiArmorOutput; return this; } - public Builder compressionId(int compressionId) { - this.mCompressionId = compressionId; + public Builder setCompressionId(int compressionId) { + mCompressionId = compressionId; return this; } - public Builder encryptionMasterKeyIds(long[] encryptionMasterKeyIds) { + public Builder setEncryptionMasterKeyIds(long[] encryptionMasterKeyIds) { this.mEncryptionMasterKeyIds = encryptionMasterKeyIds; return this; } - public Builder symmetricPassphrase(String symmetricPassphrase) { + public Builder setSymmetricPassphrase(String symmetricPassphrase) { this.mSymmetricPassphrase = symmetricPassphrase; return this; } - public Builder symmetricEncryptionAlgorithm(int symmetricEncryptionAlgorithm) { - this.mSymmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm; + public Builder setSymmetricEncryptionAlgorithm(int symmetricEncryptionAlgorithm) { + mSymmetricEncryptionAlgorithm = symmetricEncryptionAlgorithm; return this; } - public Builder signatureMasterKeyId(long signatureMasterKeyId) { + public Builder setSignatureMasterKeyId(long signatureMasterKeyId) { this.mSignatureMasterKeyId = signatureMasterKeyId; return this; } - public Builder signatureHashAlgorithm(int signatureHashAlgorithm) { - this.mSignatureHashAlgorithm = signatureHashAlgorithm; + public Builder setSignatureHashAlgorithm(int signatureHashAlgorithm) { + mSignatureHashAlgorithm = signatureHashAlgorithm; return this; } - public Builder signatureForceV3(boolean signatureForceV3) { - this.mSignatureForceV3 = signatureForceV3; + public Builder setSignatureForceV3(boolean signatureForceV3) { + mSignatureForceV3 = signatureForceV3; return this; } - public Builder signaturePassphrase(String signaturePassphrase) { - this.mSignaturePassphrase = signaturePassphrase; + public Builder setSignaturePassphrase(String signaturePassphrase) { + mSignaturePassphrase = signaturePassphrase; return this; } @@ -197,7 +197,7 @@ public class PgpSignEncrypt { * @param encryptToSigner * @return */ - public Builder encryptToSigner(boolean encryptToSigner) { + public Builder setEncryptToSigner(boolean encryptToSigner) { this.mEncryptToSigner = encryptToSigner; return this; } @@ -208,7 +208,7 @@ public class PgpSignEncrypt { * @param cleartextInput * @return */ - public Builder cleartextInput(boolean cleartextInput) { + public Builder setCleartextInput(boolean cleartextInput) { this.mCleartextInput = cleartextInput; return this; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java index 6e0179aaa..1e0cfaa8e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/OpenPgpService.java @@ -170,14 +170,14 @@ public class OpenPgpService extends RemoteService { new ProviderHelper(getContext()), PgpHelper.getFullVersion(getContext()), inputData, os); - builder.enableAsciiArmorOutput(asciiArmor) - .signatureHashAlgorithm(accSettings.getHashAlgorithm()) - .signatureForceV3(false) - .signatureMasterKeyId(accSettings.getKeyId()) - .signaturePassphrase(passphrase); + builder.setEnableAsciiArmorOutput(asciiArmor) + .setSignatureHashAlgorithm(accSettings.getHashAlgorithm()) + .setSignatureForceV3(false) + .setSignatureMasterKeyId(accSettings.getKeyId()) + .setSignaturePassphrase(passphrase); // TODO: currently always assume cleartext input, no sign-only of binary currently! - builder.cleartextInput(true); + builder.setCleartextInput(true); try { builder.build().execute(); @@ -254,10 +254,10 @@ public class OpenPgpService extends RemoteService { new ProviderHelper(getContext()), PgpHelper.getFullVersion(getContext()), inputData, os); - builder.enableAsciiArmorOutput(asciiArmor) - .compressionId(accSettings.getCompression()) - .symmetricEncryptionAlgorithm(accSettings.getEncryptionAlgorithm()) - .encryptionMasterKeyIds(keyIds); + builder.setEnableAsciiArmorOutput(asciiArmor) + .setCompressionId(accSettings.getCompression()) + .setSymmetricEncryptionAlgorithm(accSettings.getEncryptionAlgorithm()) + .setEncryptionMasterKeyIds(keyIds); if (sign) { String passphrase; @@ -274,13 +274,13 @@ public class OpenPgpService extends RemoteService { } // sign and encrypt - builder.signatureHashAlgorithm(accSettings.getHashAlgorithm()) - .signatureForceV3(false) - .signatureMasterKeyId(accSettings.getKeyId()) - .signaturePassphrase(passphrase); + builder.setSignatureHashAlgorithm(accSettings.getHashAlgorithm()) + .setSignatureForceV3(false) + .setSignatureMasterKeyId(accSettings.getKeyId()) + .setSignaturePassphrase(passphrase); } else { // encrypt only - builder.signatureMasterKeyId(Constants.key.none); + builder.setSignatureMasterKeyId(Constants.key.none); } try { @@ -337,10 +337,10 @@ public class OpenPgpService extends RemoteService { }, inputData, os ); - builder.allowSymmetricDecryption(false) // no support for symmetric encryption - .allowedKeyIds(allowedKeyIds) // allow only private keys associated with + builder.setAllowSymmetricDecryption(false) // no support for symmetric encryption + .setAllowedKeyIds(allowedKeyIds) // allow only private keys associated with // accounts of this app - .passphrase(passphrase); + .setPassphrase(passphrase); PgpDecryptVerifyResult decryptVerifyResult; try { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java index 7b12f525c..5615b59c4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/KeychainIntentService.java @@ -313,24 +313,24 @@ public class KeychainIntentService extends IntentService new ProviderHelper(this), PgpHelper.getFullVersion(this), inputData, outStream); - builder.progressable(this); + builder.setProgressable(this); - builder.enableAsciiArmorOutput(useAsciiArmor) - .compressionId(compressionId) - .symmetricEncryptionAlgorithm( + builder.setEnableAsciiArmorOutput(useAsciiArmor) + .setCompressionId(compressionId) + .setSymmetricEncryptionAlgorithm( Preferences.getPreferences(this).getDefaultEncryptionAlgorithm()) - .signatureForceV3(Preferences.getPreferences(this).getForceV3Signatures()) - .encryptionMasterKeyIds(encryptionKeyIds) - .symmetricPassphrase(symmetricPassphrase) - .signatureMasterKeyId(signatureKeyId) - .signatureHashAlgorithm( + .setSignatureForceV3(Preferences.getPreferences(this).getForceV3Signatures()) + .setEncryptionMasterKeyIds(encryptionKeyIds) + .setSymmetricPassphrase(symmetricPassphrase) + .setSignatureMasterKeyId(signatureKeyId) + .setSignatureHashAlgorithm( Preferences.getPreferences(this).getDefaultHashAlgorithm()) - .signaturePassphrase( + .setSignaturePassphrase( PassphraseCacheService.getCachedPassphrase(this, signatureKeyId)); // this assumes that the bytes are cleartext (valid for current implementation!) if (target == TARGET_BYTES) { - builder.cleartextInput(true); + builder.setCleartextInput(true); } builder.build().execute(); @@ -457,10 +457,10 @@ public class KeychainIntentService extends IntentService } }, inputData, outStream); - builder.progressable(this); + builder.setProgressable(this); - builder.allowSymmetricDecryption(true) - .passphrase(passphrase); + builder.setAllowSymmetricDecryption(true) + .setPassphrase(passphrase); PgpDecryptVerifyResult decryptVerifyResult = builder.build().execute(); |