Select pub key when email could not be found

This commit is contained in:
Dominik Schürmann
2013-09-08 17:04:33 +02:00
parent 6fdae001cc
commit 4d1d3f6f5e
8 changed files with 159 additions and 89 deletions

View File

@@ -735,14 +735,14 @@ public class PgpMain {
*/
public static void encryptAndSign(Context context, ProgressDialogUpdater progress,
InputData data, OutputStream outStream, boolean useAsciiArmor, int compression,
ArrayList<Long> encryptionKeyIds, String encryptionPassphrase,
long[] encryptionKeyIds, String encryptionPassphrase,
int symmetricEncryptionAlgorithm, long signatureKeyId, int signatureHashAlgorithm,
boolean signatureForceV3, String signaturePassphrase) throws IOException,
PgpGeneralException, PGPException, NoSuchProviderException, NoSuchAlgorithmException,
SignatureException {
if (encryptionKeyIds == null) {
encryptionKeyIds = new ArrayList<Long>();
encryptionKeyIds = new long[0];
}
ArmoredOutputStream armorOut = null;
@@ -759,7 +759,7 @@ public class PgpMain {
PGPSecretKeyRing signingKeyRing = null;
PGPPrivateKey signaturePrivateKey = null;
if (encryptionKeyIds.size() == 0 && encryptionPassphrase == null) {
if (encryptionKeyIds.length == 0 && encryptionPassphrase == null) {
throw new PgpGeneralException(
context.getString(R.string.error_noEncryptionKeysOrPassPhrase));
}
@@ -795,7 +795,7 @@ public class PgpMain {
PGPEncryptedDataGenerator cPk = new PGPEncryptedDataGenerator(encryptorBuilder);
if (encryptionKeyIds.size() == 0) {
if (encryptionKeyIds.length == 0) {
// Symmetric encryption
Log.d(Constants.TAG, "encryptionKeyIds length is 0 -> symmetric encryption");