Skip to content

Clojars Release 0.5.4

Compare
Choose a tag to compare
@xsc xsc released this 19 Sep 11:30
· 73 commits to main since this release

Breaking Changes

  • POSSIBLY BREAKING: The internal ByteConvertable protocol moved from pandect.gen.hmac-generator into pandect.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, Files or InputStreams 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"]