X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_identity_provider_service.h;h=e533f6f8cffea8aae9417883e8354cd7b5f438f3;hb=17047b7bcbe3f1756028058a9887416c6afab5d8;hp=9bee9ce2a943d67aad9c4bed920a28cdd0ab3f6a;hpb=8feaa39e16ba33a192b32097e8087c9aca2d27d8;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_identity_provider_service.h index 9bee9ce2a..e533f6f8c 100644 --- a/src/include/gnunet_identity_provider_service.h +++ b/src/include/gnunet_identity_provider_service.h @@ -1,6 +1,6 @@ /* 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 @@ -19,19 +19,12 @@ */ /** - * @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 @@ -82,7 +75,8 @@ struct GNUNET_IDENTITY_PROVIDER_Operation; */ 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. @@ -90,14 +84,18 @@ typedef void * 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); /** @@ -177,17 +175,52 @@ GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op); /** * 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 @@ -195,8 +228,10 @@ GNUNET_IDENTITY_PROVIDER_string_to_ticket (const char* input, } #endif -/** @} */ /* end of group identity */ /* ifndef GNUNET_IDENTITY_PROVIDER_SERVICE_H */ #endif + +/** @} */ /* end of group identity */ + /* end of gnunet_identity_provider_service.h */