More CLI tests & clearer bytes stuff

Ensuring that bytes are written correctly on all supported Python
versions, including when writing to stdout.
diff --git a/tests/test_pem.py b/tests/test_pem.py
index 61a66fc..3e03ab0 100644
--- a/tests/test_pem.py
+++ b/tests/test_pem.py
@@ -86,3 +86,17 @@
         key = rsa.key.PrivateKey.load_pkcs1(private_key_pem)
         self.assertTrue(is_bytes(key.save_pkcs1(format='DER')))
         self.assertTrue(is_bytes(key.save_pkcs1(format='PEM')))
+
+
+class TestByteInput(unittest.TestCase):
+    """Tests that PEM and DER can be loaded from bytes."""
+
+    def test_bytes_public(self):
+        key = rsa.key.PublicKey.load_pkcs1_openssl_pem(public_key_pem.encode('ascii'))
+        self.assertTrue(is_bytes(key.save_pkcs1(format='DER')))
+        self.assertTrue(is_bytes(key.save_pkcs1(format='PEM')))
+
+    def test_bytes_private(self):
+        key = rsa.key.PrivateKey.load_pkcs1(private_key_pem.encode('ascii'))
+        self.assertTrue(is_bytes(key.save_pkcs1(format='DER')))
+        self.assertTrue(is_bytes(key.save_pkcs1(format='PEM')))