mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
OX: Trust secret key upon backup import
This commit is contained in:
parent
a587827ef8
commit
15b8a81493
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,6 @@ import org.jivesoftware.smack.packet.Message;
|
|||
import org.jivesoftware.smack.util.Async;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.ox.callback.backup.AskForBackupCodeCallback;
|
||||
import org.jivesoftware.smackx.ox.callback.backup.DisplayBackupCodeCallback;
|
||||
|
@ -475,9 +474,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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue