Liking cljdoc? Tell your friends :D

hara.security.base.key


->keyclj

(->key k)

idempotent function converting input into a key

(-> {:type "AES", :mode :secret, :format "RAW", :encoded "euHlt5sHWhRpbKZHjrwrrQ=="} (->key) (->key)) => java.security.Key

idempotent function converting input into a key

(-> {:type "AES",
     :mode :secret,
     :format "RAW",
     :encoded "euHlt5sHWhRpbKZHjrwrrQ=="}
    (->key)
    (->key))
=> java.security.Key
raw docstring

generate-keyclj

(generate-key)
(generate-key algo {:keys [provider] :as opts})

generates a key according to algorithm

(generate-key) => ("AES" "ARCFOUR" "Blowfish" "DES" "DESede" "HmacMD5" "HmacSHA1" "HmacSHA224" "HmacSHA256" "HmacSHA384" "HmacSHA512" ...)

(generate-key "AES" {:length 128}) ;;=> #key {:type "AES", ;; :mode :secret, ;; :format "RAW", ;; :encoded "AQgv8l+vJNfnEWuhHs55wg=="}

(generate-key "HmacSHA224" {:length 40}) ;;=> #key {:type "HmacSHA224", ;; :mode :secret, ;; :format "RAW", ;; :encoded "0qQkmic="}

generates a key according to algorithm

(generate-key)
=> ("AES" "ARCFOUR" "Blowfish" "DES" "DESede"
          "HmacMD5" "HmacSHA1" "HmacSHA224" "HmacSHA256"
          "HmacSHA384" "HmacSHA512" ...)

(generate-key "AES" {:length 128})
;;=> #key {:type "AES",
;;         :mode :secret,
;;         :format "RAW",
;;         :encoded "AQgv8l+vJNfnEWuhHs55wg=="}

(generate-key "HmacSHA224" {:length 40})
;;=> #key {:type "HmacSHA224",
;;         :mode :secret,
;;         :format "RAW",
;;         :encoded "0qQkmic="}
raw docstring

generate-key-pairclj

(generate-key-pair)
(generate-key-pair type {:keys [provider] :as opts})

creates a public and private key pair

(generate-key-pair) => ("DSA" "DiffieHellman" "EC" "RSA")

(generate-key-pair "RSA" {:length 512}) ;;=> [#key {:type "RSA", ;; :mode :public, ;; :format "X.509", ;; :encoded "...." } ;; #key {:type "RSA", ;; :mode :private, ;; :format "PKCS#8", ;; :encoded "..."}]

creates a public and private key pair

(generate-key-pair)
=> ("DSA" "DiffieHellman" "EC" "RSA")

(generate-key-pair "RSA" {:length 512})
;;=> [#key {:type "RSA",
;;          :mode :public,
;;          :format "X.509",
;;          :encoded "...." }
;;    #key {:type "RSA",
;;          :mode :private,
;;          :format "PKCS#8",
;;          :encoded "..."}]
raw docstring

init-key-generatorclj

(init-key-generator gen {:keys [length params random] :as opts})

initializes a KeyGenerator object

initializes a `KeyGenerator` object
raw docstring

init-key-pair-generatorclj

(init-key-pair-generator gen {:keys [length params random] :as opts})

initializes a KeyPairGenerator object

initializes a `KeyPairGenerator` object
raw docstring

key->mapclj

(key->map k)

returns a map representation of a key

(key->map (generate-key "AES" {:length 128})) => (contains {:type "AES", :mode :secret, :format "RAW", :encoded string?})

returns a map representation of a key

(key->map (generate-key "AES" {:length 128}))
=> (contains {:type "AES",
              :mode :secret,
              :format "RAW",
              :encoded string?})
raw docstring

key-modeclj

(key-mode k)

returns the mode of a key

(->> (generate-key-pair "RSA" {:length 512}) (map key-mode)) => [:public :private]

returns the mode of a key

(->> (generate-key-pair "RSA" {:length 512})
     (map key-mode))
=> [:public :private]
raw docstring

key-typeclj

(key-type k)

returns the type of a key

(key-type (generate-key "AES" {:length 128})) => "AES"

returns the type of a key

(key-type (generate-key "AES" {:length 128}))
=> "AES"
raw docstring

map->keycljmultimethod

transforms a map into a key

(map->key {:type "AES", :mode :secret, :format "RAW", :encoded "euHlt5sHWhRpbKZHjrwrrQ=="}) => java.security.Key

transforms a map into a key

(map->key {:type "AES",
           :mode :secret,
           :format "RAW",
           :encoded "euHlt5sHWhRpbKZHjrwrrQ=="})
=> java.security.Key
raw docstring

to-bytesclj

(to-bytes input)

transforms input to a byte array

transforms input to a byte array
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close