use autovalue for PgpSignEncryptData class
This commit is contained in:
@@ -170,11 +170,11 @@ public class BackupOperation extends BaseOperation<BackupKeyringParcel> {
|
||||
throws FileNotFoundException {
|
||||
PgpSignEncryptOperation signEncryptOperation = new PgpSignEncryptOperation(mContext, mKeyRepository, mProgressable, mCancelled);
|
||||
|
||||
PgpSignEncryptData data = new PgpSignEncryptData();
|
||||
PgpSignEncryptData.Builder data = PgpSignEncryptData.builder();
|
||||
data.setSymmetricPassphrase(cryptoInput.getPassphrase());
|
||||
data.setEnableAsciiArmorOutput(backupInput.mEnableAsciiArmorOutput);
|
||||
data.setAddBackupHeader(true);
|
||||
PgpSignEncryptInputParcel inputParcel = new PgpSignEncryptInputParcel(data);
|
||||
PgpSignEncryptInputParcel inputParcel = new PgpSignEncryptInputParcel(data.build());
|
||||
|
||||
InputStream inStream = mContext.getContentResolver().openInputStream(plainUri);
|
||||
|
||||
|
||||
@@ -83,10 +83,10 @@ public class BenchmarkOperation extends BaseOperation<BenchmarkInputParcel> {
|
||||
SignEncryptOperation op =
|
||||
new SignEncryptOperation(mContext, mKeyRepository,
|
||||
new ProgressScaler(mProgressable, i*(50/numRepeats), (i+1)*(50/numRepeats), 100), mCancelled);
|
||||
PgpSignEncryptData data = new PgpSignEncryptData();
|
||||
PgpSignEncryptData.Builder data = PgpSignEncryptData.builder();
|
||||
data.setSymmetricPassphrase(passphrase);
|
||||
data.setSymmetricEncryptionAlgorithm(OpenKeychainSymmetricKeyAlgorithmTags.AES_128);
|
||||
SignEncryptParcel input = new SignEncryptParcel(data);
|
||||
SignEncryptParcel input = new SignEncryptParcel(data.build());
|
||||
input.setBytes(buf);
|
||||
encryptResult = op.execute(input, new CryptoInputParcel());
|
||||
log.add(encryptResult, 1);
|
||||
|
||||
@@ -77,18 +77,6 @@ public class SignEncryptOperation extends BaseOperation<SignEncryptParcel> {
|
||||
SecurityTokenSignOperationsBuilder pendingInputBuilder = null;
|
||||
|
||||
PgpSignEncryptData data = input.getData();
|
||||
// if signing subkey has not explicitly been set, get first usable subkey capable of signing
|
||||
if (data.getSignatureMasterKeyId() != Constants.key.none
|
||||
&& data.getSignatureSubKeyId() == null) {
|
||||
try {
|
||||
long signKeyId = mKeyRepository.getCachedPublicKeyRing(
|
||||
data.getSignatureMasterKeyId()).getSecretSignId();
|
||||
data.setSignatureSubKeyId(signKeyId);
|
||||
} catch (PgpKeyNotFoundException e) {
|
||||
Log.e(Constants.TAG, "Key not found", e);
|
||||
return new SignEncryptResult(SignEncryptResult.RESULT_ERROR, log, results);
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if (checkCancelled()) {
|
||||
|
||||
Reference in New Issue
Block a user