@Test public void testRsaEncryptor() { RsaEncryptor rsaEncryptor = new RsaEncryptor(null, this.publicKey); byte[] testResult = rsaEncryptor.encrypt(this.testData.getBytes()); Assert.assertNotNull(testResult); RsaEncryptor rsaDecryptor = new RsaEncryptor(this.privateKey, null); String verifyResult = new String(rsaDecryptor.decrypt(testResult)); Assert.assertNotNull(verifyResult); Assert.assertEquals(this.testData, verifyResult); }
public RsaEncryptor() { this.generateKey(); }
RsaEncryptor implements Encryptor { public RsaEncryptor() { this.generateKey(); } }
RsaEncryptor implements Encryptor { public RsaEncryptor() { this.generateKey(); } RsaEncryptor();  RsaEncryptor(String privateKey, String publicKey); }
RsaEncryptor implements Encryptor { public RsaEncryptor() { this.generateKey(); } RsaEncryptor();  RsaEncryptor(String privateKey, String publicKey); String getPublicKey(); String getPrivateKey(); @Override ENCRYPT_TYPE getType(); @Override byte[] encrypt(byte[] bytes); @Override byte[] decrypt(byte[] bytes); }
RsaEncryptor implements Encryptor { public RsaEncryptor() { this.generateKey(); } RsaEncryptor();  RsaEncryptor(String privateKey, String publicKey); String getPublicKey(); String getPrivateKey(); @Override ENCRYPT_TYPE getType(); @Override byte[] encrypt(byte[] bytes); @Override byte[] decrypt(byte[] bytes);  }