 
   `:now` is an integer POSIX time and defaults to the current time.
   `:leeway` is an integer number of seconds and defaults to zero."
-  [claims {:keys [max-age iss aud now leeway allow-expired]
-           :or {now (util/now) leeway 0 allow-expired false}}]
+  [claims {:keys [max-age iss aud now leeway]
+           :or {now (util/now) leeway 0}}]
   (let [now (util/to-timestamp now)]
 
     ;; Check the `:iss` claim.

                      {:type :validation :cause :aud})))

    ;; Check the `:exp` claim.
    (when (and (:exp claims) (<= (:exp claims) (- now leeway))
            (not allow-expired))
      (throw (ex-info (format "Token is expired (%s)" (:exp claims))
                      {:type :validation :cause :exp})))


   {:pre [(map? claims)]}
   (let [payload (-> (prepare-claims claims opts)
                     (json/generate-string))]
     (jws/sign payload pkey opts))))

(defn unsign
  ([message pkey] (unsign message pkey {}))
  ([message pkey {:keys [skip-validation] :or {skip-validation false} :as opts}]
   (try
     (let [claims (-> (jws/unsign message pkey opts)
                      (codecs/bytes->str)
                      (json/parse-string true))]
       (if skip-validation
         claims
         (validate-claims claims opts)))
     (catch com.fasterxml.jackson.core.JsonParseException e
       (throw (ex-info "Message seems corrupt or manipulated."
                       {:type :validation :cause :signature}))))))
