code: public String toUrlSafe() {
      if (key == null) {
        throw new IllegalStateException("Cannot build safe URL without a key.");
      }
  
      boolean legacy = isLegacy;
  
      StringBuilder config = assembleConfig(false);
      byte[] encrypted = legacy ? aes128Encrypt(config, key) : hmacSha1(config, key);
      String encoded = base64Encode(encrypted);
  
      CharSequence suffix = legacy ? image : config;
      return host + encoded + "/" + suffix;
    }
docs: Build a safe version of the URL. Requires a non-{@code null} key.