diff --git a/examples/io.h b/examples/io.h
index cecd8919dc2b657bcf70b9f186e9d259c67135d7..b7530f38756810a161cd8837cbbe0c046db4d235 100644
--- a/examples/io.h
+++ b/examples/io.h
@@ -55,11 +55,12 @@ simple_random(struct yarrow256_ctx *ctx, const char *name);
 int
 hash_file(const struct nettle_hash *hash, void *ctx, FILE *f);
 
-#if WITH_PUBLIC_KEY
+struct rsa_public_key;
+struct rsa_private_key;
+
 int
 read_rsa_key(const char *name,
 	     struct rsa_public_key *pub,
 	     struct rsa_private_key *priv);
-#endif
 
 #endif /* NETTLE_EXAMPLES_IO_H_INCLUDED */