diff --git a/Codec/Encryption/OpenPGP/Internal.hs b/Codec/Encryption/OpenPGP/Internal.hs
--- a/Codec/Encryption/OpenPGP/Internal.hs
+++ b/Codec/Encryption/OpenPGP/Internal.hs
@@ -26,7 +26,9 @@
 import qualified Crypto.Hash.SHA384 as SHA384
 import qualified Crypto.Hash.SHA512 as SHA512
 
-import qualified Data.ASN1.DER as DER
+import qualified Data.ASN1.BinaryEncoding as ASN1BE
+import qualified Data.ASN1.Encoding as ASN1E
+import qualified Data.ASN1.Stream as ASN1S
 import Data.Bits (testBit, shiftL, shiftR, (.&.))
 import Data.ByteString (ByteString)
 import qualified Data.ByteString as B
@@ -78,14 +80,12 @@
 
 asn1Prefix :: HashAlgorithm -> ByteString
 asn1Prefix ha = do
-    let start = DER.Start DER.Sequence
+    let start = ASN1S.Start ASN1S.Sequence
     let (blen, oid) = (bitLength ha, hashOid ha)
-    let numpty = DER.Null
-    let end = DER.End DER.Sequence
-    let fakeint = DER.OctetString (BL.pack (replicate ((blen `div` 8) - 1) 0 ++ [1]))
-    case DER.encodeASN1Stream [start,start,oid,numpty,end,fakeint,end] of
-        Left _ -> error "encodeASN1 failure"
-        Right l -> B.concat . BL.toChunks $ getPrefix l
+    let numpty = ASN1S.Null
+    let end = ASN1S.End ASN1S.Sequence
+    let fakeint = ASN1S.OctetString (BL.pack (replicate ((blen `div` 8) - 1) 0 ++ [1]))
+    B.concat . BL.toChunks $ getPrefix (ASN1E.encodeASN1 ASN1BE.DER [start,start,oid,numpty,end,fakeint,end])
     where
         getPrefix = BL.reverse . BL.dropWhile (==0) . BL.drop 1 . BL.reverse
         bitLength DeprecatedMD5 = 128
@@ -96,14 +96,14 @@
         bitLength SHA512 = 512
         bitLength SHA224 = 224
         bitLength _ = 0
-        hashOid DeprecatedMD5 = DER.OID [1,2,840,113549,2,5]
-        hashOid RIPEMD160 = DER.OID [1,3,36,3,2,1]
-        hashOid SHA1 = DER.OID [1,3,14,3,2,26]
-        hashOid SHA224 = DER.OID [2,16,840,1,101,3,4,2,4]
-        hashOid SHA256 = DER.OID [2,16,840,1,101,3,4,2,1]
-        hashOid SHA384 = DER.OID [2,16,840,1,101,3,4,2,2]
-        hashOid SHA512 = DER.OID [2,16,840,1,101,3,4,2,3]
-        hashOid _ = DER.OID []
+        hashOid DeprecatedMD5 = ASN1S.OID [1,2,840,113549,2,5]
+        hashOid RIPEMD160 = ASN1S.OID [1,3,36,3,2,1]
+        hashOid SHA1 = ASN1S.OID [1,3,14,3,2,26]
+        hashOid SHA224 = ASN1S.OID [2,16,840,1,101,3,4,2,4]
+        hashOid SHA256 = ASN1S.OID [2,16,840,1,101,3,4,2,1]
+        hashOid SHA384 = ASN1S.OID [2,16,840,1,101,3,4,2,2]
+        hashOid SHA512 = ASN1S.OID [2,16,840,1,101,3,4,2,3]
+        hashOid _ = ASN1S.OID []
 
 pubkeyToMPIs :: PKey -> [MPI]
 pubkeyToMPIs (RSAPubKey k) = [MPI (RSA.public_n k), MPI (RSA.public_e k)]
diff --git a/Data/Conduit/OpenPGP/Compression.hs b/Data/Conduit/OpenPGP/Compression.hs
--- a/Data/Conduit/OpenPGP/Compression.hs
+++ b/Data/Conduit/OpenPGP/Compression.hs
@@ -12,11 +12,12 @@
 import Codec.Encryption.OpenPGP.Types
 import Data.Conduit
 import qualified Data.Conduit.List as CL
+import qualified Data.Conduit.Util as CU
 
 conduitCompress :: MonadThrow m => CompressionAlgorithm -> Conduit Pkt m Pkt
-conduitCompress algo = conduitState [] push (close algo)
+conduitCompress algo = CU.conduitState [] push (close algo)
     where
-        push state input = return $ StateProducing (input : state) []
+        push state input = return $ CU.StateProducing (input : state) []
         close a state = return [compressPkts a state]
 
 conduitDecompress :: MonadThrow m => Conduit Pkt m Pkt
diff --git a/Data/Conduit/OpenPGP/Keyring.hs b/Data/Conduit/OpenPGP/Keyring.hs
--- a/Data/Conduit/OpenPGP/Keyring.hs
+++ b/Data/Conduit/OpenPGP/Keyring.hs
@@ -11,6 +11,7 @@
 
 import qualified Data.ByteString as B
 import Data.Conduit
+import qualified Data.Conduit.Util as CU
 
 import qualified Data.Map as Map
 import qualified Data.Set as Set
@@ -28,48 +29,48 @@
 conduitToTKsDropping = conduitToTKs' False
 
 conduitToTKs' :: MonadResource m => Bool -> Conduit Pkt m TK
-conduitToTKs' intolerant = conduitState (MainKey, Nothing) push close
+conduitToTKs' intolerant = CU.conduitState (MainKey, Nothing) push close
     where
         push state input = case (state, input) of
-                               ((MainKey, _), PublicKeyPkt pkp) -> return $ StateProducing (Revs, Just (TK pkp Nothing [] [] [] [])) []
-                               ((MainKey, _), SecretKeyPkt pkp ska) -> return $ StateProducing (Revs, Just (TK pkp (Just ska) [] [] [] [])) []
-                               ((Revs, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (Revs, Just (TK pkp Nothing (revs ++ [s]) uids uats subs)) []
-                               ((Revs, Just (TK pkp Nothing revs _ uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp Nothing revs [(u, [])] uats subs)) []
-                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (Uids, Just (TK pkp Nothing revs (addUidSig s uids) uats subs)) []
-                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp Nothing revs (uids ++ [(u, [])]) uats subs)) []
-                               ((Uids, Just (TK pkp Nothing revs uids _ subs)), UserAttributePkt u) -> return $ StateProducing (UAts, Just (TK pkp Nothing revs uids [(u, [])] subs)) []
-                               ((Uids, Just (TK pkp Nothing revs uids uats _)), PublicSubkeyPkt p) -> return $ StateProducing (Subs, Just (TK pkp Nothing revs uids uats [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)])) []
-                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
-                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (UAts, Just (TK pkp Nothing revs uids (addUAtSig s uats) subs)) []
-                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), UserAttributePkt u) -> return $ StateProducing (UAts, Just (TK pkp Nothing revs uids (uats ++ [(u, [])]) subs)) []
-                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp Nothing revs (uids ++ [(u, [])]) uats subs)) []
-                               ((UAts, Just (TK pkp Nothing revs uids uats _)), PublicSubkeyPkt p) -> return $ StateProducing (Subs, Just (TK pkp Nothing revs uids uats [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)])) []
-                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
-                               ((Subs, Just (TK pkp Nothing revs uids uats subs)), PublicSubkeyPkt p) -> return $ StateProducing (Subs, Just (TK pkp Nothing revs uids uats (subs ++ [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)]))) []
+                               ((MainKey, _), PublicKeyPkt pkp) -> return $ CU.StateProducing (Revs, Just (TK pkp Nothing [] [] [] [])) []
+                               ((MainKey, _), SecretKeyPkt pkp ska) -> return $ CU.StateProducing (Revs, Just (TK pkp (Just ska) [] [] [] [])) []
+                               ((Revs, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (Revs, Just (TK pkp Nothing (revs ++ [s]) uids uats subs)) []
+                               ((Revs, Just (TK pkp Nothing revs _ uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp Nothing revs [(u, [])] uats subs)) []
+                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (Uids, Just (TK pkp Nothing revs (addUidSig s uids) uats subs)) []
+                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp Nothing revs (uids ++ [(u, [])]) uats subs)) []
+                               ((Uids, Just (TK pkp Nothing revs uids _ subs)), UserAttributePkt u) -> return $ CU.StateProducing (UAts, Just (TK pkp Nothing revs uids [(u, [])] subs)) []
+                               ((Uids, Just (TK pkp Nothing revs uids uats _)), PublicSubkeyPkt p) -> return $ CU.StateProducing (Subs, Just (TK pkp Nothing revs uids uats [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)])) []
+                               ((Uids, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ CU.StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
+                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (UAts, Just (TK pkp Nothing revs uids (addUAtSig s uats) subs)) []
+                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), UserAttributePkt u) -> return $ CU.StateProducing (UAts, Just (TK pkp Nothing revs uids (uats ++ [(u, [])]) subs)) []
+                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp Nothing revs (uids ++ [(u, [])]) uats subs)) []
+                               ((UAts, Just (TK pkp Nothing revs uids uats _)), PublicSubkeyPkt p) -> return $ CU.StateProducing (Subs, Just (TK pkp Nothing revs uids uats [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)])) []
+                               ((UAts, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ CU.StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
+                               ((Subs, Just (TK pkp Nothing revs uids uats subs)), PublicSubkeyPkt p) -> return $ CU.StateProducing (Subs, Just (TK pkp Nothing revs uids uats (subs ++ [(PublicSubkeyPkt p, SigVOther 0 B.empty, Nothing)]))) []
                                ((Subs, Just (TK pkp Nothing revs uids uats subs)), SignaturePkt s) -> case sType s of
-                                                                                        SubkeyBindingSig -> return $ StateProducing (Subs, Just (TK pkp Nothing revs uids uats (setBSig s subs))) []
-                                                                                        SubkeyRevocationSig -> return $ StateProducing (Subs, Just (TK pkp Nothing revs uids uats (setRSig s subs))) []
+                                                                                        SubkeyBindingSig -> return $ CU.StateProducing (Subs, Just (TK pkp Nothing revs uids uats (setBSig s subs))) []
+                                                                                        SubkeyRevocationSig -> return $ CU.StateProducing (Subs, Just (TK pkp Nothing revs uids uats (setRSig s subs))) []
                                                                                         _ -> return (dropOrError intolerant state $ "Unexpected subkey sig: " ++ show (fst state) ++ "/" ++ show input)
-                               ((Subs, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
-                               ((Revs, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (Revs, Just (TK pkp mska (revs ++ [s]) uids uats subs)) []
-                               ((Revs, Just (TK pkp mska revs _ uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp mska revs [(u, [])] uats subs)) []
-                               ((Uids, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (Uids, Just (TK pkp mska revs (addUidSig s uids) uats subs)) []
-                               ((Uids, Just (TK pkp mska revs uids uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp mska revs (uids ++ [(u, [])]) uats subs)) []
-                               ((Uids, Just (TK pkp mska revs uids _ subs)), UserAttributePkt u) -> return $ StateProducing (UAts, Just (TK pkp mska revs uids [(u, [])] subs)) []
-                               ((Uids, Just (TK pkp mska revs uids uats _)), SecretSubkeyPkt p s) -> return $ StateProducing (Subs, Just (TK pkp mska revs uids uats [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)])) []
-                               ((Uids, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
-                               ((UAts, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ StateProducing (UAts, Just (TK pkp mska revs uids (addUAtSig s uats) subs)) []
-                               ((UAts, Just (TK pkp mska revs uids uats subs)), UserAttributePkt u) -> return $ StateProducing (UAts, Just (TK pkp mska revs uids (uats ++ [(u, [])]) subs)) []
-                               ((UAts, Just (TK pkp mska revs uids uats subs)), UserIdPkt u) -> return $ StateProducing (Uids, Just (TK pkp mska revs (uids ++ [(u, [])]) uats subs)) []
-                               ((UAts, Just (TK pkp mska revs uids uats _)), SecretSubkeyPkt p s) -> return $ StateProducing (Subs, Just (TK pkp mska revs uids uats [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)])) []
-                               ((UAts, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
-                               ((Subs, Just (TK pkp mska revs uids uats subs)), SecretSubkeyPkt p s) -> return $ StateProducing (Subs, Just (TK pkp mska revs uids uats (subs ++ [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)]))) []
+                               ((Subs, Just (TK pkp Nothing revs uids uats subs)), PublicKeyPkt p) -> return $ CU.StateProducing (Revs, Just (TK p Nothing [] [] [] [])) [TK pkp Nothing revs uids uats subs]
+                               ((Revs, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (Revs, Just (TK pkp mska (revs ++ [s]) uids uats subs)) []
+                               ((Revs, Just (TK pkp mska revs _ uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp mska revs [(u, [])] uats subs)) []
+                               ((Uids, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (Uids, Just (TK pkp mska revs (addUidSig s uids) uats subs)) []
+                               ((Uids, Just (TK pkp mska revs uids uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp mska revs (uids ++ [(u, [])]) uats subs)) []
+                               ((Uids, Just (TK pkp mska revs uids _ subs)), UserAttributePkt u) -> return $ CU.StateProducing (UAts, Just (TK pkp mska revs uids [(u, [])] subs)) []
+                               ((Uids, Just (TK pkp mska revs uids uats _)), SecretSubkeyPkt p s) -> return $ CU.StateProducing (Subs, Just (TK pkp mska revs uids uats [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)])) []
+                               ((Uids, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ CU.StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
+                               ((UAts, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> return $ CU.StateProducing (UAts, Just (TK pkp mska revs uids (addUAtSig s uats) subs)) []
+                               ((UAts, Just (TK pkp mska revs uids uats subs)), UserAttributePkt u) -> return $ CU.StateProducing (UAts, Just (TK pkp mska revs uids (uats ++ [(u, [])]) subs)) []
+                               ((UAts, Just (TK pkp mska revs uids uats subs)), UserIdPkt u) -> return $ CU.StateProducing (Uids, Just (TK pkp mska revs (uids ++ [(u, [])]) uats subs)) []
+                               ((UAts, Just (TK pkp mska revs uids uats _)), SecretSubkeyPkt p s) -> return $ CU.StateProducing (Subs, Just (TK pkp mska revs uids uats [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)])) []
+                               ((UAts, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ CU.StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
+                               ((Subs, Just (TK pkp mska revs uids uats subs)), SecretSubkeyPkt p s) -> return $ CU.StateProducing (Subs, Just (TK pkp mska revs uids uats (subs ++ [(SecretSubkeyPkt p s, SigVOther 0 B.empty, Nothing)]))) []
                                ((Subs, Just (TK pkp mska revs uids uats subs)), SignaturePkt s) -> case sType s of
-                                                                                        SubkeyBindingSig -> return $ StateProducing (Subs, Just (TK pkp mska revs uids uats (setBSig s subs))) []
-                                                                                        SubkeyRevocationSig -> return $ StateProducing (Subs, Just (TK pkp mska revs uids uats (setRSig s subs))) []
+                                                                                        SubkeyBindingSig -> return $ CU.StateProducing (Subs, Just (TK pkp mska revs uids uats (setBSig s subs))) []
+                                                                                        SubkeyRevocationSig -> return $ CU.StateProducing (Subs, Just (TK pkp mska revs uids uats (setRSig s subs))) []
                                                                                         _ -> return (dropOrError intolerant state $ "Unexpected subkey sig: " ++ show (fst state) ++ "/" ++ show input)
-                               ((Subs, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
-                               ((_,_), TrustPkt _) -> return $ StateProducing state []
+                               ((Subs, Just (TK pkp mska revs uids uats subs)), SecretKeyPkt p s) -> return $ CU.StateProducing (Revs, Just (TK p (Just s) [] [] [] [])) [TK pkp mska revs uids uats subs]
+                               ((_,_), TrustPkt _) -> return $ CU.StateProducing state []
                                _ -> return (dropOrError intolerant state $ "Unexpected packet: " ++ show (fst state) ++ "/" ++ show input)
         close (_, Nothing) = return []
         close (_, Just tk) = return [tk]
@@ -80,15 +81,15 @@
         sType (SigV3 st _ _ _ _ _ _) = st
         sType (SigV4 st _ _ _ _ _ _) = st
         sType _ = error "This should never happen."
-        dropOrError :: Bool -> (Phase, Maybe TK) -> String -> ConduitStateResult (Phase, Maybe TK) Pkt TK
+        dropOrError :: Bool -> (Phase, Maybe TK) -> String -> CU.ConduitStateResult (Phase, Maybe TK) Pkt TK
         dropOrError True _ e = error e
-        dropOrError False s _ = StateProducing s []
+        dropOrError False s _ = CU.StateProducing s []
 
 sinkKeyringMap :: MonadResource m => Sink TK m Keyring
-sinkKeyringMap = sinkState Map.empty push close
+sinkKeyringMap = CU.sinkState Map.empty push close
     where
-        push :: MonadResource m => Keyring -> TK -> m (SinkStateResult Keyring TK Keyring)
-        push state input = return . StateProcessing $ foldl (\m x -> Map.insert x (newset x input m) m) state (eoks input)
+        push :: MonadResource m => Keyring -> TK -> m (CU.SinkStateResult Keyring TK Keyring)
+        push state input = return . CU.StateProcessing $ foldl (\m x -> Map.insert x (newset x input m) m) state (eoks input)
         close = return
         eoks (TK pkp _ _ _ _ subs) = eightOctetKeyID pkp:map (eightOctetKeyID . pl . \(x,_,_) -> x) subs
         pl (PublicSubkeyPkt pkp) = pkp
diff --git a/Data/Conduit/OpenPGP/Verify.hs b/Data/Conduit/OpenPGP/Verify.hs
--- a/Data/Conduit/OpenPGP/Verify.hs
+++ b/Data/Conduit/OpenPGP/Verify.hs
@@ -8,6 +8,7 @@
 ) where
 
 import Data.Conduit
+import qualified Data.Conduit.Util as CU
 import Data.Time.Clock (UTCTime)
 
 import Codec.Encryption.OpenPGP.Internal (PktStreamContext(..), emptyPSC)
@@ -15,17 +16,17 @@
 import Codec.Encryption.OpenPGP.Verify (verifySig)
 
 conduitVerify :: MonadResource m => Keyring -> Maybe UTCTime -> Conduit Pkt m (Either String Verification)
-conduitVerify kr mt = conduitState emptyPSC push close
+conduitVerify kr mt = CU.conduitState emptyPSC push close
     where
-        push state ld@(LiteralDataPkt {}) = return $ StateProducing (state { lastLD = ld }) []
-        push state uid@(UserIdPkt _) = return $ StateProducing (state { lastUIDorUAt = uid }) []
-        push state uat@(UserAttributePkt _) = return $ StateProducing (state { lastUIDorUAt = uat }) []
-        push state pk@(PublicKeyPkt _) = return $ StateProducing (state { lastPrimaryKey = pk }) []
-        push state pk@(PublicSubkeyPkt _) = return $ StateProducing (state { lastSubkey = pk }) []
-        push state sk@(SecretKeyPkt _ _) = return $ StateProducing (state { lastPrimaryKey = sk }) []
-        push state sk@(SecretSubkeyPkt _ _) = return $ StateProducing (state { lastSubkey = sk }) []
-        push state sig@(SignaturePkt (SigV4 {})) = return $ StateProducing state { lastSig = sig } [verifySig kr sig state mt]
-        push state (OnePassSignaturePkt _ _ _ _ _ False) = return $ StateProducing state []
-        push state _ = return $ StateProducing state []
+        push state ld@(LiteralDataPkt {}) = return $ CU.StateProducing (state { lastLD = ld }) []
+        push state uid@(UserIdPkt _) = return $ CU.StateProducing (state { lastUIDorUAt = uid }) []
+        push state uat@(UserAttributePkt _) = return $ CU.StateProducing (state { lastUIDorUAt = uat }) []
+        push state pk@(PublicKeyPkt _) = return $ CU.StateProducing (state { lastPrimaryKey = pk }) []
+        push state pk@(PublicSubkeyPkt _) = return $ CU.StateProducing (state { lastSubkey = pk }) []
+        push state sk@(SecretKeyPkt _ _) = return $ CU.StateProducing (state { lastPrimaryKey = sk }) []
+        push state sk@(SecretSubkeyPkt _ _) = return $ CU.StateProducing (state { lastSubkey = sk }) []
+        push state sig@(SignaturePkt (SigV4 {})) = return $ CU.StateProducing state { lastSig = sig } [verifySig kr sig state mt]
+        push state (OnePassSignaturePkt _ _ _ _ _ False) = return $ CU.StateProducing state []
+        push state _ = return $ CU.StateProducing state []
         close _ = return []
         normLineEndings = id  -- FIXME
diff --git a/hOpenPGP.cabal b/hOpenPGP.cabal
--- a/hOpenPGP.cabal
+++ b/hOpenPGP.cabal
@@ -1,5 +1,5 @@
 Name:                hOpenPGP
-Version:             0.5
+Version:             0.5.1
 Synopsis:            native Haskell implementation of OpenPGP (RFC4880)
 Description:         native Haskell implementation of OpenPGP (RFC4880)
 Homepage:            http://floss.scru.org/hOpenPGP/
@@ -126,15 +126,15 @@
                      , Data.Conduit.OpenPGP.Verify
   Other-Modules: Codec.Encryption.OpenPGP.Internal
                , Codec.Encryption.OpenPGP.SerializeForSigs
-  Build-depends: asn1-data
+  Build-depends: asn1-data             > 0.7
                , attoparsec
                , base                  > 4       && < 5
                , base64-bytestring
                , bytestring
                , bzlib
                , cereal
-               , cereal-conduit        >= 0.5    && < 0.6
-               , conduit               > 0.4     && < 0.5
+               , cereal-conduit        >= 0.6    && < 0.7
+               , conduit               >= 0.5    && < 0.6
                , containers
                , cryptocipher
                , cryptohash
@@ -150,15 +150,15 @@
   type:       exitcode-stdio-1.0
   main-is:    tests/suite.hs
   Ghc-options: -Wall
-  Build-depends: asn1-data
+  Build-depends: asn1-data             > 0.7
                , attoparsec
                , base                  > 4       && < 5
                , base64-bytestring
                , bytestring
                , bzlib
                , cereal
-               , cereal-conduit        >= 0.5    && < 0.6
-               , conduit               > 0.4     && < 0.5
+               , cereal-conduit        >= 0.6    && < 0.7
+               , conduit               >= 0.5    && < 0.6
                , containers
                , cryptocipher
                , cryptohash
@@ -171,7 +171,7 @@
                , test-framework
                , test-framework-hunit
                , exception-transformers > 0.3 && < 0.4
-               , resourcet > 0.3 && < 0.4
+               , resourcet              > 0.4 && < 0.5
   default-language: Haskell2010
 
 source-repository head
