diff --git a/System/Certificate/X509/MacOS.hs b/System/Certificate/X509/MacOS.hs
--- a/System/Certificate/X509/MacOS.hs
+++ b/System/Certificate/X509/MacOS.hs
@@ -2,6 +2,7 @@
 	( findCertificate
 	) where
 
+import Data.PEM (pemParseLBS, PEM(..))
 import Data.Certificate.X509
 import System.Process
 import Data.ByteString hiding (filter, map)
@@ -16,7 +17,7 @@
 findCertificate :: (X509 -> Bool) -> IO (Maybe X509)
 findCertificate f = do
   (_, Just hout, _, ph) <- createProcess (proc "security" ["find-certificate", "-pa", keyChain]) { std_out = CreatePipe }
-  pems <- parsePEMs <$> hGetContents hout
+  pems <- either error id . pemParseLBS <$> LBS.hGetContents hout
   _ <- waitForProcess ph
-  let targets = rights $ map (decodeCertificate . LBS.fromChunks .  pure . snd) $ filter ((=="CERTIFICATE") . fst) pems
+  let targets = rights $ map (decodeCertificate . LBS.fromChunks .  pure . pemContent) $ filter ((=="CERTIFICATE") . pemName) pems
   return $ listToMaybe $ filter f targets
diff --git a/certificate.cabal b/certificate.cabal
--- a/certificate.cabal
+++ b/certificate.cabal
@@ -1,5 +1,5 @@
 Name:                certificate
-Version:             1.2.0
+Version:             1.2.1
 Description:
     Certificates and Key reader/writer
     .
@@ -33,6 +33,7 @@
                    , asn1-data >= 0.6.1.3 && < 0.7
                    , crypto-pubkey-types
                    , directory
+                   , process
                    , time
   Exposed-modules:   Data.Certificate.X509
                      Data.Certificate.X509.Cert
@@ -40,17 +41,16 @@
                      Data.Certificate.KeyDSA
                      Data.Certificate.KeyRSA
                      System.Certificate.X509
-  Other-modules:     Data.Certificate.X509.Internal
                      System.Certificate.X509.Unix
+                     System.Certificate.X509.MacOS
+  Other-modules:     Data.Certificate.X509.Internal
   ghc-options:       -Wall
   if os(windows)
      cpp-options: -DWINDOWS
      Build-Depends:  Win32
-     Other-modules:  System.Certificate.X509.Win32
+     Exposed-modules:  System.Certificate.X509.Win32
   if os(OSX)
      cpp-options: -DMACOSX
-     Build-Depends:  process
-     Other-modules:  System.Certificate.X509.MacOS
 
 Executable           certificate
   Main-Is:           Certificate.hs
