diff --git a/Crypto/Types/PubKey/RSA.hs b/Crypto/Types/PubKey/RSA.hs
--- a/Crypto/Types/PubKey/RSA.hs
+++ b/Crypto/Types/PubKey/RSA.hs
@@ -116,7 +116,7 @@
 
 instance ASN1Object KeyPair where
     toASN1 (KeyPair pkey) = toASN1 pkey
-    fromASN1 = fmap (\(k,s) -> (KeyPair k, s)) . fromASN1
+    fromASN1 = either Left (\(k,s) -> Right (KeyPair k, s)) . fromASN1
 
 -- | Public key of a RSA KeyPair
 toPublicKey :: KeyPair -> PublicKey
diff --git a/crypto-pubkey-types.cabal b/crypto-pubkey-types.cabal
--- a/crypto-pubkey-types.cabal
+++ b/crypto-pubkey-types.cabal
@@ -1,5 +1,5 @@
 Name:                crypto-pubkey-types
-Version:             0.3.0
+Version:             0.3.1
 Description:         Generic cryptography public keys algorithm types
 License:             BSD3
 License-file:        LICENSE
