struct GNUNET_CRYPTO_EcdsaPublicKey *pub);
+/**
+ * Convert a string representing a private key to a private key.
+ *
+ * @param enc encoded public key
+ * @param enclen number of bytes in @a enc (without 0-terminator)
+ * @param priv where to store the private key
+ * @return #GNUNET_OK on success
+ */
+int
+GNUNET_CRYPTO_eddsa_private_key_from_string (const char *enc,
+ size_t enclen,
+ struct GNUNET_CRYPTO_EddsaPrivateKey *pub);
+
+
/**
* Convert a string representing a public key to a public key.
*
}
+/**
+ * Convert a string representing a private key to a private key.
+ *
+ * @param enc encoded public key
+ * @param enclen number of bytes in @a enc (without 0-terminator)
+ * @param priv where to store the private key
+ * @return #GNUNET_OK on success
+ */
+int
+GNUNET_CRYPTO_eddsa_private_key_from_string (const char *enc,
+ size_t enclen,
+ struct GNUNET_CRYPTO_EddsaPrivateKey *pub)
+{
+ size_t keylen = (sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)) * 8;
+
+ if (keylen % 5 > 0)
+ keylen += 5 - keylen % 5;
+ keylen /= 5;
+ if (enclen != keylen)
+ return GNUNET_SYSERR;
+
+ if (GNUNET_OK != GNUNET_STRINGS_string_to_data (enc, enclen,
+ pub,
+ sizeof (struct GNUNET_CRYPTO_EddsaPrivateKey)))
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
+}
+
+
/**
* @ingroup crypto
* Clear memory that was used to store a private key.