@Override
    public String encrypt(final String key, final String data) throws Exception {
        byte[] decoded = Base64.getDecoder().decode(key);
        RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance(RSA).generatePublic(new X509EncodedKeySpec(decoded));
        Cipher cipher = Cipher.getInstance(RSA);
        cipher.init(Cipher.ENCRYPT_MODE, pubKey);
        return Base64.getEncoder().encodeToString(cipher.doFinal(data.getBytes(StandardCharsets.UTF_8)));
    }
@Test
    public void testEncrypt() throws Exception {
        byte[] encryptedData = Base64.getMimeDecoder().decode(cryptorStrategy.encrypt(encKey, decryptedData));
        assertThat(cryptorStrategy.decrypt(decKey, encryptedData), is(decryptedData));
    }