Skip to content

Instantly share code, notes, and snippets.

@LukasRychtecky
Created July 3, 2023 12:29
Show Gist options
  • Save LukasRychtecky/468ded1591f77956d0807c75a62d15d8 to your computer and use it in GitHub Desktop.
Save LukasRychtecky/468ded1591f77956d0807c75a62d15d8 to your computer and use it in GitHub Desktop.
A script for extracting ZFO files from EML
(import '[org.bouncycastle.cms CMSSignedData])
(let [path "/my/input/path/for/zfo.eml"
reader (-> path io/file io/input-stream)
in-ba (-> (CMSSignedData. reader) .getSignedContent .getContent)
is (-> in-ba io/input-stream)]
(with-open [r (-> is io/reader)]
(with-open [w (io/writer "/my/output/path/for/extracted.xml")]
(.write w (slurp r))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment