make getSignId a secret key operation, and respect unavailable keys

This one should remedy #811, but waiting for a test
This commit is contained in:
Vincent Breitmoser
2014-10-02 19:23:08 +02:00
parent 9a296c012d
commit 37cb5c4c78
8 changed files with 38 additions and 112 deletions

View File

@@ -293,7 +293,7 @@ public class OpenPgpService extends RemoteService {
// Find the appropriate subkey to sign with
CachedPublicKeyRing signingRing =
new ProviderHelper(this).getCachedPublicKeyRing(accSettings.getKeyId());
final long sigSubKeyId = signingRing.getSignId();
final long sigSubKeyId = signingRing.getSecretSignId();
// sign-only
PgpSignEncrypt.Builder builder = new PgpSignEncrypt.Builder(
@@ -405,7 +405,7 @@ public class OpenPgpService extends RemoteService {
// Find the appropriate subkey to sign with
CachedPublicKeyRing signingRing =
new ProviderHelper(this).getCachedPublicKeyRing(accSettings.getKeyId());
final long sigSubKeyId = signingRing.getSignId();
final long sigSubKeyId = signingRing.getSecretSignId();
String passphrase;
if (data.hasExtra(OpenPgpApi.EXTRA_PASSPHRASE)) {