Clojars Release 0.5.4
Breaking Changes
- POSSIBLY BREAKING: The internal
ByteConvertable
protocol moved frompandect.gen.hmac-generator
intopandect.utils.convert
.
Features
This release implements RSA signature functions for MD2, MD5, SHA-1, SHA-256, SHA-384 and SHA-512, as well as DSA functions for SHA-1:
(require '[pandect.algo.sha1 :as sha1])
(let [pair (-> (doto (java.security.KeyPairGenerator/getInstance "RSA")
(.initialize 768))
(.genKeyPair))]
(def private-key (.getPrivate pair))
(def public-key (.getPublic pair)))
(sha1/sha1-rsa "Trust me!" private-key)
;; => "a98690722fafb61c8f6576d8fd8130a85c35..."
(sha1/sha1-rsa-verify "Trust me!" *1 public-key)
;; => true
Just as all other of pandect's functions, these take byte arrays, strings, File
s or InputStream
s as first parameter.
Additionally, two occurrences of count
have been replaced with alength
and String.length()
respectively, to remove some indirection.
Artifact Coordinates
[pandect "0.5.4"]