1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-16 01:02:06 +01:00

Trust key from backup upon restore

This commit is contained in:
Paul Schaub 2020-07-04 20:02:50 +02:00
parent 8850a2950c
commit 1c7ffb5720
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -479,9 +479,11 @@ public final class OpenPgpManager extends Manager {
String backupCode = codeCallback.askForBackupCode();
PGPSecretKeyRing secretKeys = SecretKeyBackupHelper.restoreSecretKeyBackup(backup, backupCode);
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(secretKeys);
provider.getStore().importSecretKey(getJidOrThrow(), secretKeys);
provider.getStore().importPublicKey(getJidOrThrow(), BCUtil.publicKeyRingFromSecretKeyRing(secretKeys));
getOpenPgpSelf().trust(fingerprint);
return new OpenPgpV4Fingerprint(secretKeys);
}