                                         private-key
                                         public-key)]
     (write-cert-to-inventory! cacert (:cert-inventory ca-settings))
-    (utils/key->pem! public-key (:capub ca-settings))
-    (utils/key->pem! private-key
-      (create-file-with-perms (:cakey ca-settings) private-key-perms))
-    (utils/cert->pem! cacert (:cacert ca-settings))
-    (utils/crl->pem! cacrl (:cacrl ca-settings))))
+    (write-public-key public-key (:capub ca-settings))
+    (write-private-key private-key (:cakey ca-settings))
+    (write-cert cacert (:cacert ca-settings))
+    (write-crl cacrl (:cacrl ca-settings))))
 
 (schema/defn split-hostnames :- (schema/maybe [schema/Str])
   "Given a comma-separated list of hostnames, return a list of the

  (let [keypair (utils/generate-key-pair keylength)
        public-key (utils/get-public-key keypair)
        private-key (utils/get-private-key keypair)]
    (utils/key->pem! public-key hostpubkey)
    (utils/key->pem! private-key
                     (create-file-with-perms hostprivkey
                                             private-key-perms))
    public-key))

(schema/defn generate-master-ssl-keys! :- (schema/pred utils/public-key?)

        serial-count (count serials)
        new-crl (utils/revoke-multiple original-crl ca-private-key
                                       ca-public-key serials)]
    (write-crl new-crl cacrl)
    (log/debug (if (= 1 serial-count)
                 (i18n/trs "Revoked 1 certificate.")
                 (i18n/trs "Revoked {0} certificates." serial-count)))))
