aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_uri.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-03-31 06:40:20 +0000
committerChristian Grothoff <christian@grothoff.org>2010-03-31 06:40:20 +0000
commit5d27676deba6a3f404acf088d3bedc8a0e1d2b1b (patch)
tree9e866163ab820e3e415a3ee50d4021f610fdf24b /src/fs/fs_uri.c
parent73b12cfde8218af4f9b246b495e546c17b5d5810 (diff)
downloadgnunet-5d27676deba6a3f404acf088d3bedc8a0e1d2b1b.tar.gz
gnunet-5d27676deba6a3f404acf088d3bedc8a0e1d2b1b.zip
fs hxing
Diffstat (limited to 'src/fs/fs_uri.c')
-rw-r--r--src/fs/fs_uri.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c
index b402fa830..5ddb48f2a 100644
--- a/src/fs/fs_uri.c
+++ b/src/fs/fs_uri.c
@@ -882,6 +882,34 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
882 882
883 883
884/** 884/**
885 * Create an SKS URI from a namespace and an identifier.
886 *
887 * @param ns namespace
888 * @param id identifier
889 * @param emsg where to store an error message
890 * @return an FS URI for the given namespace and identifier
891 */
892struct GNUNET_FS_Uri *
893GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns,
894 const char *id,
895 char **emsg)
896{
897 struct GNUNET_FS_Uri *ns_uri;
898 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk;
899
900 ns_uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri));
901 ns_uri->type = sks;
902 GNUNET_CRYPTO_rsa_key_get_public (ns->key,
903 &pk);
904 GNUNET_CRYPTO_hash (&pk,
905 sizeof (pk),
906 &ns_uri->data.sks.namespace);
907 ns_uri->data.sks.identifier = GNUNET_strdup (id);
908 return ns_uri;
909}
910
911
912/**
885 * Canonicalize a keyword. 913 * Canonicalize a keyword.
886 * 914 *
887 * @param in input string (the keyword) 915 * @param in input string (the keyword)