diff --git a/async/examples/serv1.rs b/async/examples/serv1.rs
index 7139e69f3379bf1540fadea329a522e762262ce5..e2df57e34989e80dc70b1c117d2108b9c78348d8 100644
--- a/async/examples/serv1.rs
+++ b/async/examples/serv1.rs
@@ -131,13 +131,26 @@ impl ServBehaviour for DemoServer {
     }
 
     fn have_auth_pubkey(&self, user: TextString) -> bool {
-        false
+        true
     }
 
     fn auth_password(&mut self, user: TextString, password: TextString) -> bool {
         user.as_str().unwrap_or("") == "matt" && password.as_str().unwrap_or("") == "pw"
     }
 
+    fn auth_pubkey(&mut self, user: TextString, pubkey: &PubKey) -> bool {
+        if user.as_str().unwrap_or("") != "matt" {
+            return false
+        }
+
+        // key is tested1
+        pubkey.matches_openssh("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkNdReJERy1rPGqdfTN73TnayPR+lTNhdZvOgkAOs5x")
+        .unwrap_or_else(|e| {
+            warn!("Failed loading openssh key: {e}");
+            false
+        })
+    }
+
     fn open_session(&mut self, chan: u32) -> ChanOpened {
         if self.sess.is_some() {
             ChanOpened::Failure(ChanFail::SSH_OPEN_ADMINISTRATIVELY_PROHIBITED)
diff --git a/sshproto/src/packets.rs b/sshproto/src/packets.rs
index 600a4f15a36db36dd942508c25ea5dc0df2a23f0..42003bbcfe21d8aef99e75bd66682813ab796cd5 100644
--- a/sshproto/src/packets.rs
+++ b/sshproto/src/packets.rs
@@ -252,6 +252,22 @@ impl<'a> PubKey<'a> {
             PubKey::Unknown(u) => Err(u),
         }
     }
+
+    pub fn matches_openssh(&self, k: &str) -> Result<bool> {
+        let k = ssh_key::PublicKey::from_openssh(k)
+            .map_err(|_| {
+                Error::msg("Unsupported OpenSSH key")
+            })?;
+
+        let m = match (k.key_data(), self) {
+            (ssh_key::public::KeyData::Ed25519(kssh),
+                PubKey::Ed25519(kself)) => {
+                kssh.0 == kself.key.0
+            }
+            _ => false,
+        };
+        Ok(m)
+    }
 }