mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 20:42:06 +01:00
Dont swallow exception
This commit is contained in:
parent
ca549b0313
commit
7eaf688ccc
1 changed files with 1 additions and 6 deletions
|
@ -20,8 +20,6 @@ import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||||
import org.jivesoftware.smackx.ox.OpenPgpProvider;
|
import org.jivesoftware.smackx.ox.OpenPgpProvider;
|
||||||
|
@ -36,8 +34,6 @@ import org.jxmpp.jid.BareJid;
|
||||||
|
|
||||||
public class SecretKeyBackupHelper {
|
public class SecretKeyBackupHelper {
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(SecretKeyBackupHelper.class.getName());
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a secure backup code.
|
* Generate a secure backup code.
|
||||||
*
|
*
|
||||||
|
@ -76,9 +72,8 @@ public class SecretKeyBackupHelper {
|
||||||
byte[] bytes = provider.getStore().getSecretKeyRingBytes(owner, fingerprint);
|
byte[] bytes = provider.getStore().getSecretKeyRingBytes(owner, fingerprint);
|
||||||
buffer.write(bytes);
|
buffer.write(bytes);
|
||||||
} catch (MissingOpenPgpKeyPairException | IOException e) {
|
} catch (MissingOpenPgpKeyPairException | IOException e) {
|
||||||
LOGGER.log(Level.WARNING, "Cannot backup secret key " + Long.toHexString(fingerprint.getKeyId()) + ".", e);
|
throw new SmackOpenPgpException("Cannot backup secret key " + Long.toHexString(fingerprint.getKeyId()) + ".", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return createSecretkeyElement(provider, buffer.toByteArray(), backupCode);
|
return createSecretkeyElement(provider, buffer.toByteArray(), backupCode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue