/*
This file is part of GNUnet.
- Copyright (C) 2016 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2016 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
*/
/**
- * @file include/gnunet_identity_provider_service.h
- * @brief Identity provider service; implements identity provider for GNUnet
* @author Martin Schanzenbach
*
- * Egos in GNUnet are ECDSA keys. You assume an ego by using (signing
- * with) a particular private key. As GNUnet users are expected to
- * have many egos, we need an identity service to allow users to
- * manage their egos. The identity service manages the egos (private
- * keys) of the local user; it does NOT manage egos of other users
- * (public keys). For giving names to other users and manage their
- * public keys securely, we use GNS.
+ * @file
+ * Identity provider service; implements identity provider for GNUnet
*
- * @defgroup identity-provider service
+ * @defgroup identity-provider Identity Provider service
* @{
*/
#ifndef GNUNET_IDENTITY_PROVIDER_SERVICE_H
*/
typedef void
(*GNUNET_IDENTITY_PROVIDER_ExchangeCallback)(void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Token *token);
+ const struct GNUNET_IDENTITY_PROVIDER_Token *token,
+ uint64_t ticket_nonce);
/**
* Method called when a token has been issued.
* token
*
* @param cls closure
+ * @param grant the label in GNS pointing to the token
* @param ticket the ticket
+ * @param token the issued token
* @param name name assigned by the user for this ego,
* NULL if the user just deleted the ego and it
* must thus no longer be used
*/
typedef void
(*GNUNET_IDENTITY_PROVIDER_IssueCallback)(void *cls,
- const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket);
+ const char *grant,
+ const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
+ const struct GNUNET_IDENTITY_PROVIDER_Token *token);
/**
/**
* Convenience API
*/
+
+/**
+ * Destroy token
+ *
+ * @param token the token
+ */
+void
+GNUNET_IDENTITY_PROVIDER_token_destroy(struct GNUNET_IDENTITY_PROVIDER_Token *token);
+
+/**
+ * Returns string representation of token. A JSON-Web-Token.
+ *
+ * @param token the token
+ * @return The JWT (must be freed)
+ */
char *
GNUNET_IDENTITY_PROVIDER_token_to_string (const struct GNUNET_IDENTITY_PROVIDER_Token *token);
+/**
+ * Returns string representation of ticket. Base64-Encoded
+ *
+ * @param ticket the ticket
+ * @return the Base64-Encoded ticket
+ */
char *
GNUNET_IDENTITY_PROVIDER_ticket_to_string (const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket);
-
+/**
+ * Created a ticket from a string (Base64 encoded ticket)
+ *
+ * @param input Base64 encoded ticket
+ * @param ticket pointer where the ticket is stored
+ * @return GNUNET_OK
+ */
int
GNUNET_IDENTITY_PROVIDER_string_to_ticket (const char* input,
struct GNUNET_IDENTITY_PROVIDER_Ticket **ticket);
+/**
+ * Destroys a ticket
+ *
+ * @param ticket the ticket to destroy
+ */
+void
+GNUNET_IDENTITY_PROVIDER_ticket_destroy(struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket);
+
#if 0 /* keep Emacsens' auto-indent happy */
{
#endif
}
#endif
-/** @} */ /* end of group identity */
/* ifndef GNUNET_IDENTITY_PROVIDER_SERVICE_H */
#endif
+
+/** @} */ /* end of group identity */
+
/* end of gnunet_identity_provider_service.h */