(ns buddy.crypto.keys
  (:import java.security.Key))

(defn make-secret-key
  "Generates a Key instance from given raw string key."
  [^String skey]
  (let [rawkey (.getBytes skey "UTF-8")]
    (proxy [Key] []
      (getFormat [] nil)
      (getEncoded [] rawkey)
      (toString [] skey))))

(ns buddy.crypto.keys
  (:require [buddy.crypto.core :refer [str->bytes]])
  (:import java.security.Key))

(defn make-secret-key
  "Generates a Key instance from given raw string key."
  [^String skey]
  (let [rawkey (str->bytes skey)]
    (proxy [Key] []
      (getFormat [] nil)
      (getEncoded [] rawkey)
      (toString [] skey))))

Use byddy.crypto utils function for get a byte array from string on make-secret-key function.
Use byddy.crypto utils function for get a byte array from string on make-secret-key function.

funcool/buddy