docs: @SneakyThrows
      protected void generate(final Resource file, final int bits) {
          if (!ResourceUtils.doesResourceExist(file)) {
              val rsaJsonWebKey = RsaJwkGenerator.generateJwk(bits);
              val jsonWebKeySet = new JsonWebKeySet(rsaJsonWebKey);
              val data = jsonWebKeySet.toJson(JsonWebKey.OutputControlLevel.INCLUDE_PRIVATE);
              val location = file instanceof FileSystemResource
                  ? FileSystemResource.class.cast(file).getFile()
                  : DEFAULT_JWKS_LOCATION;
              FileUtils.write(location, data, StandardCharsets.UTF_8);
              LOGGER.debug("Generated JSON web keystore at [{}]", location);
          } else {
              LOGGER.debug("Located JSON web keystore at [{}]", file);
          }
      }