(->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
(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="}
(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 "..."}]
(init-key-generator gen {:keys [length params random] :as opts})
initializes a KeyGenerator
object
initializes a `KeyGenerator` object
(init-key-pair-generator gen {:keys [length params random] :as opts})
initializes a KeyPairGenerator
object
initializes a `KeyPairGenerator` object
(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?})
(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]
(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"
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
(to-bytes input)
transforms input to a byte array
transforms input to a byte array
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close