RSAEncryption { private static byte[] encryptDecrypt(byte[] content, Key key, int mode) throws CryptoException { try { Cipher cipher = Cipher.getInstance("RSA"); cipher.init(mode, key); return cipher.doFinal(content); } catch (Exception e) { throw new CryptoException("error decrypting with RSA: " + e.getMessage()); } }  static byte[] encrypt(byte[] content, Key key); static byte[] decrypt(byte[] content, Key key); static byte[] sign(byte[] content, PrivateKey privateKey); static boolean verifySign(byte[] content, byte[] sign,
			PublicKey publicKey);  }
@Test public void testEncryptDecrypt() throws CryptoException { KeyManager keyManager = KeyManager.getInstance(); keyManager.generateKeyPair(); byte[] content = new byte[] { 'a', 'b', 'c' }; byte[] encrypted = RSAEncryption.encrypt(content, keyManager.getPublicKey()); byte[] decrypted = RSAEncryption.decrypt(encrypted, keyManager.getPrivateKey()); assertFalse(Arrays.equals(content, encrypted)); assertArrayEquals(content, decrypted); }