   [keystore prefix pem]
   {:pre  [(instance? KeyStore keystore)
           (string? prefix)
-          pem]
+          (not (nil? pem))]
    :post [(instance? KeyStore %)]}
   (with-open [r (reader pem)]
     (CertificateUtils/associateCertsFromReader keystore prefix r)))

  [keystore alias pem-private-key pw pem-cert]
  {:pre  [(instance? KeyStore keystore)
          (string? alias)
          pem-private-key
          (string? pw)]
   :post [(instance? KeyStore %)]}
  (with-open [key-reader  (reader pem-private-key)

  "Given the path to a PEM file (or some other object supported by clojure's `reader`),
  decodes the contents into a collection of `PrivateKey` instances."
  [pem]
  {:pre  [(not (nil? pem))]
   :post [(every? (fn [x] (instance? PrivateKey x)) %)]}
  (with-open [r (reader pem)]
    (CertificateUtils/pemToPrivateKeys r)))
