};
+/**
+ * Get hash of the public key of a namespace.
+ *
+ * @param ns namespace
+ * @param id buffer to store the key in
+ * @return GNUNET_OK on success
+ * GNUNET_SYSERR on failure (contents of id remain intact)
+ */
+int
+GNUNET_FS_namespace_get_public_key_hash (struct GNUNET_FS_Namespace *ns,
+ struct GNUNET_HashCode *id)
+{
+ if ((NULL == ns) || (NULL == id))
+ return GNUNET_SYSERR;
+ GNUNET_CRYPTO_rsa_get_public_key_hash (ns->key, id);
+ return GNUNET_OK;
+}
+
+
/**
* Function called with a filename of a namespace. Reads the key and
* calls the callback.
ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
ns_uri->type = GNUNET_FS_URI_SKS;
- GNUNET_CRYPTO_rsa_key_get_public (ns->key, &pk);
- GNUNET_CRYPTO_hash (&pk, sizeof (pk), &ns_uri->data.sks.ns);
+ GNUNET_FS_namespace_get_public_key_hash (ns, &ns_uri->data.sks.ns);
ns_uri->data.sks.identifier = GNUNET_strdup (id);
return ns_uri;
}
GNUNET_FS_namespace_dup (struct GNUNET_FS_Namespace *ns);
+/**
+ * Get hash of the public key of a namespace.
+ *
+ * @param ns namespace
+ * @param id buffer to store the key in
+ * @return GNUNET_OK on success
+ * GNUNET_SYSERR on failure (contents of id remain intact)
+ */
+int
+GNUNET_FS_namespace_get_public_key_hash (struct GNUNET_FS_Namespace *ns,
+ struct GNUNET_HashCode *id);
+
+
/**
* Delete a namespace handle. Can be used for a clean shutdown (free
* memory) or also to freeze the namespace to prevent further