mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-26 20:47:58 +01:00
Trust key from backup upon restore
This commit is contained in:
parent
8850a2950c
commit
1c7ffb5720
1 changed files with 2 additions and 0 deletions
|
@ -479,9 +479,11 @@ public final class OpenPgpManager extends Manager {
|
||||||
String backupCode = codeCallback.askForBackupCode();
|
String backupCode = codeCallback.askForBackupCode();
|
||||||
|
|
||||||
PGPSecretKeyRing secretKeys = SecretKeyBackupHelper.restoreSecretKeyBackup(backup, backupCode);
|
PGPSecretKeyRing secretKeys = SecretKeyBackupHelper.restoreSecretKeyBackup(backup, backupCode);
|
||||||
|
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(secretKeys);
|
||||||
provider.getStore().importSecretKey(getJidOrThrow(), secretKeys);
|
provider.getStore().importSecretKey(getJidOrThrow(), secretKeys);
|
||||||
provider.getStore().importPublicKey(getJidOrThrow(), BCUtil.publicKeyRingFromSecretKeyRing(secretKeys));
|
provider.getStore().importPublicKey(getJidOrThrow(), BCUtil.publicKeyRingFromSecretKeyRing(secretKeys));
|
||||||
|
|
||||||
|
getOpenPgpSelf().trust(fingerprint);
|
||||||
|
|
||||||
return new OpenPgpV4Fingerprint(secretKeys);
|
return new OpenPgpV4Fingerprint(secretKeys);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue