mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Remove unnecessary lines from OX backup restore routine
This commit is contained in:
parent
b7fe56fb9b
commit
a587827ef8
1 changed files with 0 additions and 11 deletions
|
@ -20,7 +20,6 @@ import static org.jivesoftware.smackx.ox.util.OpenPgpPubSubUtil.PEP_NODE_PUBLIC_
|
|||
import static org.jivesoftware.smackx.ox.util.OpenPgpPubSubUtil.PEP_NODE_PUBLIC_KEYS_NOTIFY;
|
||||
import static org.jivesoftware.smackx.ox.util.OpenPgpPubSubUtil.publishPublicKey;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
@ -76,12 +75,9 @@ import org.jivesoftware.smackx.pubsub.PubSubException;
|
|||
import org.jivesoftware.smackx.pubsub.PubSubFeature;
|
||||
|
||||
import org.bouncycastle.openpgp.PGPException;
|
||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
||||
import org.jxmpp.jid.BareJid;
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||
|
@ -482,13 +478,6 @@ public final class OpenPgpManager extends Manager {
|
|||
provider.getStore().importSecretKey(getJidOrThrow(), secretKeys);
|
||||
provider.getStore().importPublicKey(getJidOrThrow(), BCUtil.publicKeyRingFromSecretKeyRing(secretKeys));
|
||||
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream(2048);
|
||||
for (PGPSecretKey sk : secretKeys) {
|
||||
PGPPublicKey pk = sk.getPublicKey();
|
||||
if (pk != null) pk.encode(buffer);
|
||||
}
|
||||
PGPPublicKeyRing publicKeys = new PGPPublicKeyRing(buffer.toByteArray(), new BcKeyFingerprintCalculator());
|
||||
provider.getStore().importPublicKey(getJidOrThrow(), publicKeys);
|
||||
|
||||
return new OpenPgpV4Fingerprint(secretKeys);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue