1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-08 12:01:09 +01:00

Enable importing keys again

This commit is contained in:
Paul Schaub 2018-06-21 15:57:56 +02:00
parent ef00f50d79
commit 9566f5ae65
2 changed files with 9 additions and 3 deletions

View file

@ -409,7 +409,12 @@ public class PainlessOpenPgpProvider implements OpenPgpProvider {
throw new SmackOpenPgpException("Could not create SecretKeyRingCollection from SecretKeyRing.", e);
}
} else {
secretKeyRings = PGPSecretKeyRingCollection.addSecretKeyRing(secretKeyRings, secretKeys);
try {
secretKeyRings = PGPSecretKeyRingCollection.addSecretKeyRing(secretKeyRings, secretKeys);
} catch (IllegalArgumentException e) {
LOGGER.log(Level.INFO, "Skip key " + Long.toHexString(secretKeys.getPublicKey().getKeyID()) +
" as it is already part of the key ring.");
}
}
getStore().storeSecretKeyRing(owner, secretKeyRings);