summaryrefslogtreecommitdiff
path: root/src/include/gnunet_credential_service.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_credential_service.h')
-rw-r--r--src/include/gnunet_credential_service.h73
1 files changed, 31 insertions, 42 deletions
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h
index 7b179e99f..b64bb350c 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -11,7 +11,7 @@
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -56,26 +56,27 @@ struct GNUNET_CREDENTIAL_Handle;
struct GNUNET_CREDENTIAL_Request;
/*
- * Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
- */
-enum GNUNET_CREDENTIAL_CredentialFlags
-{
- // Subject had credentials before, but have been revoked now
+* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
+*/
+enum GNUNET_CREDENTIAL_CredentialFlags {
+
+ //Subject had credentials before, but have been revoked now
GNUNET_CREDENTIAL_FLAG_REVOKED=0,
- // Subject flag indicates that the subject is a holder of this credential and may present it as such
+ //Subject flag indicates that the subject is a holder of this credential and may present it as such
GNUNET_CREDENTIAL_FLAG_SUBJECT=1,
- // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
+ //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
GNUNET_CREDENTIAL_FLAG_ISSUER=2
+
};
GNUNET_NETWORK_STRUCT_BEGIN
/**
* The attribute delegation record
*/
-struct GNUNET_CREDENTIAL_DelegationRecord
-{
+struct GNUNET_CREDENTIAL_DelegationRecord {
+
/**
* Number of delegation sets in this record
*/
@@ -94,8 +95,8 @@ struct GNUNET_CREDENTIAL_DelegationRecord
/**
* The attribute delegation record
*/
-struct GNUNET_CREDENTIAL_DelegationRecordSet
-{
+struct GNUNET_CREDENTIAL_DelegationRecordSet {
+
/**
* Public key of the subject this attribute was delegated to
*/
@@ -113,8 +114,8 @@ GNUNET_NETWORK_STRUCT_END
/**
* The attribute delegation record
*/
-struct GNUNET_CREDENTIAL_DelegationSet
-{
+struct GNUNET_CREDENTIAL_DelegationSet {
+
/**
* Public key of the subject this attribute was delegated to
*/
@@ -132,8 +133,8 @@ struct GNUNET_CREDENTIAL_DelegationSet
/**
* A delegation
*/
-struct GNUNET_CREDENTIAL_Delegation
-{
+struct GNUNET_CREDENTIAL_Delegation {
+
/**
* The issuer of the delegation
*/
@@ -169,8 +170,8 @@ struct GNUNET_CREDENTIAL_Delegation
/**
* A credential
*/
-struct GNUNET_CREDENTIAL_Credential
-{
+struct GNUNET_CREDENTIAL_Credential {
+
/**
* The issuer of the credential
*/
@@ -200,6 +201,7 @@ struct GNUNET_CREDENTIAL_Credential
* The attribute
*/
const char *issuer_attribute;
+
};
/**
@@ -280,16 +282,10 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
* @param credential the credentials
*/
typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls,
- unsigned int
- d_count,
- struct
- GNUNET_CREDENTIAL_Delegation
- *delegation_chain,
- unsigned int
- c_count,
- struct
- GNUNET_CREDENTIAL_Credential
- *credential);
+ unsigned int d_count,
+ struct GNUNET_CREDENTIAL_Delegation *delegation_chain,
+ unsigned int c_count,
+ struct GNUNET_CREDENTIAL_Delegate *credential);
/**
* Iterator called on obtained result for an attribute delegation.
@@ -309,8 +305,7 @@ typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
* @param result the record data that can be handed to the subject
*/
typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
- uint32_t
- success);
+ uint32_t success);
/**
@@ -335,21 +330,17 @@ struct GNUNET_CREDENTIAL_Request*
GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
const char *issuer_attribute,
- const struct
- GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
uint32_t credential_count,
- const struct
- GNUNET_CREDENTIAL_Credential *credentials,
+ const struct GNUNET_CREDENTIAL_Delegate *credentials,
GNUNET_CREDENTIAL_CredentialResultProcessor proc,
void *proc_cls);
struct GNUNET_CREDENTIAL_Request*
GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
- const struct
- GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
+ const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
const char *issuer_attribute,
- const struct
- GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
GNUNET_CREDENTIAL_CredentialResultProcessor proc,
void *proc_cls);
@@ -388,8 +379,7 @@ struct GNUNET_CREDENTIAL_Request *
GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
struct GNUNET_IDENTITY_Ego *issuer,
const char *attribute,
- GNUNET_CREDENTIAL_RemoveDelegateResultProcessor
- proc,
+ GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc,
void *proc_cls);
@@ -404,8 +394,7 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
* @return handle to the queued request
*/
struct GNUNET_CREDENTIAL_Credential*
-GNUNET_CREDENTIAL_credential_issue (const struct
- GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
+GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
const char *attribute,
struct GNUNET_TIME_Absolute *expiration);