*/
public class KeysTest {
@Test
public void testGenerateAndSerialize() throws Exception {
AsymmetricCipherKeyPair kp1 = RSA.makeKeypairSlow(RSA.Strength.FOUR);
String test = "this is a test 12345 \n \n !!! 123";
byte[] encrypted = RSA.encrypt((RSAKeyParameters) kp1.getPublic(), test);
String decrypted = RSA.decrypt((RSAPrivateCrtKeyParameters) kp1.getPrivate(), encrypted);
assertEquals(test, decrypted);
String serialized = RSA.serialize((RSAPrivateCrtKeyParameters) kp1.getPrivate());
RSAPrivateCrtKeyParameters priv2 = RSA.deserialize(serialized);
String decrypted2 = RSA.decrypt(priv2, encrypted);
assertEquals(test, decrypted2);
}