code: public static PublicKey getPublicKeyFromX509(String algorithm, InputStream ins) {
          if (ins == null || StringUtils.isEmpty(algorithm)) {
              return null;
          }
  
          try {
              KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
              byte[] encodedKey = IOUtils.read(ins);
              encodedKey = BASE_64.decrypt(encodedKey);
              return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey));
          } catch (NoSuchAlgorithmException | IOException | InvalidKeySpecException e) {
              throw new SecureException("构建[" + algorithm + "]私钥失败", e);
          }
      }
docs: 从X509格式的文件中获取public key
  
  @param algorithm 加密算法名称
  @param ins       X509格式的public key文件的输入流
  @return 公钥