// encrypt data asymmetrically
AsymmetricBlockCipher cipher = new RSAEngine();
cipher = new PKCS1Encoding(cipher);
cipher.init(true, keyPair.getPublic());
byte[] rsaEncryptedData = cipher.processBlock(data, 0, data.length);
Assert.assertFalse(Arrays.equals(data, rsaEncryptedData));
// decrypt data asymmetrically
cipher.init(false, keyPair.getPrivate());