public class OXSecretKeyBackupIntegrationTest extends AbstractOpenPgpIntegrationTest
AbstractSmackIntTest.Condition
alice, aliceConnection, alicePepManager, bob, bobConnection, bobPepManager, chloe, chloeConnection, chloePepManager
connection, conOne, conThree, conTwo
INSECURE_RANDOM, LOGGER, sinttestConfiguration, testRunId, timeout
Constructor and Description |
---|
OXSecretKeyBackupIntegrationTest(SmackIntegrationTestEnvironment environment)
This integration test tests the basic secret key backup and restore functionality as described
in XEP-0373 §5.
|
Modifier and Type | Method and Description |
---|---|
static void |
cleanStore() |
void |
cleanUp() |
void |
test() |
createNewTempFile, getHttpUrlConnectionFor, performActionAndWaitUntilStanzaReceived, waitUntilTrue
public OXSecretKeyBackupIntegrationTest(SmackIntegrationTestEnvironment environment) throws org.jivesoftware.smack.XMPPException.XMPPErrorException, TestNotPossibleException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException
FileBasedOpenPgpStore
implementations
which point to different directories.
First, Alice generates a fresh OpenPGP key pair.
She then creates a backup of the key in her private PEP node.
Now the OpenPgpStore
implementation is replaced by another instance to simulate a different device.
Then the secret key backup is restored from PubSub and the imported secret key is compared to the one in
the original store.
Afterwards the private PEP node is deleted from PubSub and the storage directories are emptied.environment
- XMPPException.XMPPErrorException
TestNotPossibleException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NoResponseException
public static void cleanStore()
public void cleanUp() throws org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException, org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotConnectedException
java.lang.InterruptedException
org.jivesoftware.smack.SmackException.NoResponseException
public void test() throws java.security.InvalidAlgorithmParameterException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.io.IOException, java.lang.InterruptedException, org.jivesoftware.smackx.pubsub.PubSubException.NotALeafNodeException, org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.SmackException.NotConnectedException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotLoggedInException, org.jivesoftware.smack.SmackException.FeatureNotSupportedException, org.jivesoftware.smackx.ox.exception.MissingUserIdOnKeyException, org.jivesoftware.smackx.ox.exception.NoBackupFoundException, org.jivesoftware.smackx.ox.exception.InvalidBackupCodeException, org.bouncycastle.openpgp.PGPException, org.jivesoftware.smackx.ox.exception.MissingOpenPgpKeyException
java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.io.IOException
java.lang.InterruptedException
org.jivesoftware.smackx.pubsub.PubSubException.NotALeafNodeException
org.jivesoftware.smack.SmackException.NoResponseException
org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.XMPPException.XMPPErrorException
org.jivesoftware.smack.SmackException.NotLoggedInException
org.jivesoftware.smack.SmackException.FeatureNotSupportedException
org.jivesoftware.smackx.ox.exception.MissingUserIdOnKeyException
org.jivesoftware.smackx.ox.exception.NoBackupFoundException
org.jivesoftware.smackx.ox.exception.InvalidBackupCodeException
org.bouncycastle.openpgp.PGPException
org.jivesoftware.smackx.ox.exception.MissingOpenPgpKeyException