- pk = GNUNET_CRYPTO_rsa_key_create_from_hash (&key);
- GNUNET_assert (NULL != pk);
- GNUNET_CRYPTO_rsa_key_get_public (pk, &pkc->cpy->keyspace);
- GNUNET_CRYPTO_hash (&pkc->cpy->keyspace,
- sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
- &query);
- GNUNET_assert (GNUNET_OK ==
- GNUNET_CRYPTO_rsa_sign (pk, &pkc->cpy->purpose,
- &pkc->cpy->signature));
- GNUNET_CRYPTO_rsa_key_free (pk);
+ ph = GNUNET_PSEUDONYM_get_anonymous_pseudonym_handle ();
+ GNUNET_CRYPTO_hash (&key, sizeof (key), &signing_key);
+ pkc->cpy->purpose.size = htonl (1 + pkc->slen + pkc->mdsize + sizeof (struct UBlock)
+ - sizeof (struct GNUNET_PseudonymSignature));
+ pkc->cpy->purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_FS_UBLOCK);
+ GNUNET_PSEUDONYM_sign (ph,
+ &pkc->cpy->purpose,
+ &seed,
+ &signing_key,
+ &pkc->cpy->signature);
+ GNUNET_PSEUDONYM_get_identifier (ph, &pseudonym);
+ GNUNET_PSEUDONYM_derive_verification_key (&pseudonym,
+ &signing_key,
+ &pkc->cpy->verification_key);
+ GNUNET_CRYPTO_hash (&pkc->cpy->verification_key,
+ sizeof (pkc->cpy->verification_key),
+ &query);
+ GNUNET_PSEUDONYM_destroy (ph);