+int read_rsa_public_key(RSA **key, const char *file)
+{
+ FILE *fp;
+
+ if((fp = fopen(file, "r")) == NULL)
+ {
+ syslog(LOG_ERR, _("Error reading RSA public key file `%s': %m"),
+ file);
+ return -1;
+ }
+ if(PEM_read_RSAPublicKey(fp, key, NULL, NULL) == NULL)
+ {
+ syslog(LOG_ERR, _("Reading RSA private key file `%s' failed: %m"),
+ file);
+ return -1;
+ }
+
+ return 0;
+}
+