code: public static KeyHolder buildRSAKey(int keySize) {
          try {
              KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
              generator.initialize(keySize);
              KeyPair keyPair = generator.generateKeyPair();
              PrivateKey privateKey = keyPair.getPrivate();
              PublicKey publicKey = keyPair.getPublic();
              return new KeyHolder(privateKey, publicKey);
          } catch (NoSuchAlgorithmException e) {
              throw new SecureException("当前系统没有提供生成RSA密钥对的算法", e);
          }
      }
docs: 构建RSA密钥对
  
  @param keySize keySize（必须大于等于512）
  @return RSA密钥对