   "Given an object which contains a private key, extract and return it."
   [key-object]
   {:pre [(keypair? key-object)]
-   :post [(instance? PrivateKey %)]}
+   :post [(private-key? %)]}
   (CertificateAuthority/getPrivateKey key-object))
  (instance? X509CRL x))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Utilities

(defn clojureize
  "Convert a Java data structure returned from a Java utility method into a

  `critical` : True if this is a critical extensions, false if it is not."
  [ext-container]
  {:pre [(or (certificate? ext-container)
             (certificate-request? ext-container))]
   :post [(sequential? %)
          (every? extension? %)]}
  (-> (ExtensionsUtils/getExtensionList (javaize ext-container))
      clojureize))

