public static Optional<String[]> generateKey() {
        try {
            String[] keys = new String[KEY_SIZE];
            KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(ALGORITHM);
            keyPairGenerator.initialize(SIZE, new SecureRandom());
            KeyPair keyPair = keyPairGenerator.generateKeyPair();
            keys[0] = new String(Base64.getEncoder().encode(keyPair.getPrivate().getEncoded()), DEFAULT_ENCODE);
            keys[1] = new String(Base64.getEncoder().encode(keyPair.getPublic().getEncoded()), DEFAULT_ENCODE);
            return Optional.of(keys);
        } catch (IOException | GeneralSecurityException e) {
            return Optional.empty();
        }
    }
@Test
    void generateKey() {
        Optional<String[]> optional = RsaUtil.generateKey();
        Assertions.assertTrue(optional.isPresent());
        String[] key = optional.get();
        Assertions.assertEquals(2, key.length);
    }