VOMS C API 1.5.0
 
Loading...
Searching...
No Matches
voms_apic.h
Go to the documentation of this file.
1/*********************************************************************
2 *
3 * Authors: Vincenzo Ciaschini - Vincenzo.Ciaschini@cnaf.infn.it
4 *
5 * Copyright (c) Members of the EGEE Collaboration. 2004-2010.
6 * See http://www.eu-egee.org/partners/ for details on the copyright holders.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 * Parts of this code may be based upon or even include verbatim pieces,
21 * originally written by other people, in which case the original header
22 * follows.
23 *
24 *********************************************************************/
25
26#ifndef VOMS_APIC_H
27#define VOMS_APIC_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#if !(defined(GSSAPI_H_) || defined(_GSSAPI_H) || defined(_GSSAPI_H_))
34typedef void * gss_cred_id_t;
35typedef void * gss_ctx_id_t;
36#endif
37
38#include <openssl/x509.h>
39#include <time.h>
40
41#include "newformat.h"
42
43/*#include "voms_api.h"*/
44
47struct data {
48 char *group;
49 char *role;
50 char *cap;
51};
52
53struct attribute {
54 const char *name;
55 const char *value;
56 const char *qualifier;
57};
58
59struct contactdata {
62 char *nick;
63 char *host;
64 char *contact;
65 char *vo;
66 int port;
67 char *reserved;
68 int version;
69};
70
73
74#define TYPE_NODATA 0
75#define TYPE_STD 1
76#define TYPE_CUSTOM 2
77
78
79struct voms {
80 int siglen;
81 char *signature;
82 char *user;
83 char *userca;
84 char *server;
85 char *serverca;
86 char *voname;
87 char *uri;
88 char *date1;
89 char *date2;
90 int type;
91 struct data **std;
92 char *custom;
95 char **fqan;
96 char *serial;
98 /* Fields below this line are reserved. */
99 AC *ac;
100 X509 *holder;
101};
102
103
104#define RECURSE_CHAIN 0
105#define RECURSE_NONE 1
106
107#define VERIFY_FULL 0xffffffff
108#define VERIFY_NONE 0x00000000
109#define VERIFY_DATE 0x00000001
110#define VERIFY_NOTARGET 0x00000002
111#define VERIFY_KEY 0x00000004
112#define VERIFY_SIGN 0x00000008
113#define VERIFY_ORDER 0x00000010
114#define VERIFY_ID 0x00000020
115#define VERIFY_CERTLIST 0x00000040
118
119#define VERR_NONE 0
120#define VERR_NOSOCKET 1
121#define VERR_NOIDENT 2
122#define VERR_COMM 3
123#define VERR_PARAM 4
124#define VERR_NOEXT 5
125#define VERR_NOINIT 6
126#define VERR_TIME 7
127#define VERR_IDCHECK 8
129#define VERR_EXTRAINFO 9
130#define VERR_FORMAT 10
131#define VERR_NODATA 11
132#define VERR_PARSE 12
133#define VERR_DIR 13
134#define VERR_SIGN 14
135#define VERR_SERVER 15
136#define VERR_MEM 16
137#define VERR_VERIFY 17
138#define VERR_TYPE 18
139#define VERR_ORDER 19
140#define VERR_SERVERCODE 20
141#define VERR_NOTAVAIL 21
142
143struct vomsdata {
144 char *cdir;
145 char *vdir;
146 struct voms **data;
149 char *workvo;
160 int volen;
162 /* Fields below this line are reserved. */
163 struct vomsdata *real;
164};
165
166extern struct contactdata **VOMS_FindByAlias(struct vomsdata *vd, char *alias,
167 char *system, char *user,
168 int *error);
184
185
186extern struct contactdata **VOMS_FindByVO(struct vomsdata *vd, char *vo,
187 char *system, char *user,
188 int *error);
204
205
206extern void VOMS_DeleteContacts(struct contactdata **list);
208
209extern struct vomsdata *VOMS_Init(char *voms, char *cert);
222
223extern struct voms *VOMS_Copy(struct voms *v, int *error);
230
231extern struct vomsdata *VOMS_CopyAll(struct vomsdata *vd, int *error);
238
239extern void VOMS_Delete(struct voms *v);
241
242extern int VOMS_AddTarget(struct vomsdata *vd, char *target, int *error);
247extern void VOMS_FreeTargets(struct vomsdata *vd, int *error);
250
251extern char *VOMS_ListTargets(struct vomsdata *vd, int *error); /*< Gets the list of targets for the AC.
252 \param vd The vomsdata structure.
253 \param error RETURN PARAMETER: qualifies the error message. */
254
255extern int VOMS_SetVerificationType(int type, struct vomsdata *vd, int *error); /* Sets the verification type.
256 \param type. The verification type.
257 \param vd The vomsdata structure.
258 \param error RETURN PARAMETER: qualifies the error message. */
259
260extern int VOMS_SetLifetime(int length, struct vomsdata *vd,
261 int *error);
267
268extern void VOMS_Destroy(struct vomsdata *vd);
270
271extern int VOMS_ResetOrder(struct vomsdata *vd, int *error);
276
277extern int VOMS_Ordering(char *order, struct vomsdata *vd, int *error);
286
287extern int VOMS_Contact(char *hostname, int port, char *servsubject,
288 char *command, struct vomsdata *vd, int *error);
300
301extern int VOMS_ContactRaw(char *hostname, int port, char *servsubject,
302 char *command, void **data, int *datalen, int *version,
303 struct vomsdata *vd, int *error);
317
318extern int VOMS_Retrieve(X509 *cert, STACK_OF(X509) *chain, int how,
319 struct vomsdata *vd, int *error);
331extern int VOMS_Import(char *buffer, int buflen, struct vomsdata *vd, int *error);
342extern int VOMS_Export(char **buffer, int *buflen, struct vomsdata *vd, int *error);
348
349extern struct voms *VOMS_DefaultData(struct vomsdata *vd, int *error);
356
357extern char *VOMS_ErrorMessage(struct vomsdata *vd, int error, char *buffer, int len);
365
366
367extern int VOMS_RetrieveEXT(X509_EXTENSION *ext, struct vomsdata *vd, int *error);
372
373extern int VOMS_RetrieveFromCred(gss_cred_id_t cred, int how, struct vomsdata *vd, int *error);
379
380extern int VOMS_RetrieveFromFile(FILE *file, int how, struct vomsdata *vd, int *error);
386
387extern int VOMS_RetrieveFromCtx(gss_ctx_id_t ctx, int how, struct vomsdata *vd, int *error);
393
394extern int VOMS_RetrieveFromProxy(int how, struct vomsdata *vd, int *error);
399
400extern int VOMS_RetrieveFromAC(AC*ac, struct vomsdata *vd, int *error);
405
406extern int VOMS_GetAttributeSourcesNumber(struct voms *v, struct vomsdata *vd, int *error);
407extern int VOMS_GetAttributeSourceHandle(struct voms *v, int num, struct vomsdata *vd, int *error);
408extern const char *VOMS_GetAttributeGrantor(struct voms *v, int handle, struct vomsdata *vd, int *error);
409extern int VOMS_GetAttributesNumber(struct voms *v, int handle, struct vomsdata *vd, int *error);
410extern int VOMS_GetAttribute(struct voms *v, int handle, int num, struct attribute *at, struct vomsdata *vd, int *error);
411
412extern struct vomsdata *VOMS_Duplicate(struct vomsdata *vd);
413extern AC *VOMS_GetAC(struct voms *v);
414
415extern int getMajorVersionNumber(void);
416extern int getMinorVersionNumber(void);
417extern int getPatchVersionNumber(void);
418
419extern int VOMS_SetVerificationTime(time_t verificationtime, struct vomsdata *vd, int *error);
420extern char **VOMS_GetTargetsList(struct voms *v, struct vomsdata *vd, int *error);
421extern void VOMS_FreeTargetsList(char **);
422
423extern int VOMS_SetTimeout(int t, struct vomsdata *vd, int *error);
424extern int VOMS_LoadCredentials(X509 *cert, EVP_PKEY *pkey, STACK_OF(X509)* chain, struct vomsdata *vd, int *error);
425
426#ifdef __cplusplus
427}
428#endif
429
430#endif
431
432
const char * value
Definition voms_apic.h:55
const char * name
Definition voms_apic.h:54
const char * qualifier
Definition voms_apic.h:56
The type of data returned.
Definition voms_apic.h:59
char * vo
Definition voms_apic.h:65
char * nick
Definition voms_apic.h:62
char * host
Definition voms_apic.h:63
char * contact
Definition voms_apic.h:64
char * reserved
Definition voms_apic.h:67
User's characteristics: can be repeated.
Definition voms_apic.h:47
char * cap
Definition voms_apic.h:50
char * group
Definition voms_apic.h:48
char * role
Definition voms_apic.h:49
char * signature
Definition voms_apic.h:81
char * date1
Definition voms_apic.h:88
char * user
Definition voms_apic.h:82
int datalen
Definition voms_apic.h:93
char * server
Definition voms_apic.h:84
int version
Definition voms_apic.h:94
int siglen
Definition voms_apic.h:80
int type
Definition voms_apic.h:90
char * custom
Definition voms_apic.h:92
char * voname
Definition voms_apic.h:86
AC * ac
Definition voms_apic.h:99
char * date2
Definition voms_apic.h:89
char * serverca
Definition voms_apic.h:85
char * uri
Definition voms_apic.h:87
char ** fqan
Definition voms_apic.h:95
char * serial
Definition voms_apic.h:96
X509 * holder
Definition voms_apic.h:100
struct data ** std
Definition voms_apic.h:91
char * userca
Definition voms_apic.h:83
char * cdir
Definition voms_apic.h:144
struct vomsdata * real
Definition voms_apic.h:163
char * vdir
Definition voms_apic.h:145
int volen
Definition voms_apic.h:160
char * extra_data
Definition voms_apic.h:151
struct voms ** data
Definition voms_apic.h:146
int extralen
Definition voms_apic.h:161
char * workvo
Definition voms_apic.h:149
struct vomsdata * VOMS_Duplicate(struct vomsdata *vd)
struct contactdata ** VOMS_FindByAlias(struct vomsdata *vd, char *alias, char *system, char *user, int *error)
struct vomsdata * VOMS_CopyAll(struct vomsdata *vd, int *error)
const char * VOMS_GetAttributeGrantor(struct voms *v, int handle, struct vomsdata *vd, int *error)
char ** VOMS_GetTargetsList(struct voms *v, struct vomsdata *vd, int *error)
int VOMS_RetrieveFromFile(FILE *file, int how, struct vomsdata *vd, int *error)
int VOMS_LoadCredentials(X509 *cert, EVP_PKEY *pkey, STACK_OF(X509) *chain, struct vomsdata *vd, int *error)
int getMajorVersionNumber(void)
int VOMS_ResetOrder(struct vomsdata *vd, int *error)
int VOMS_RetrieveEXT(X509_EXTENSION *ext, struct vomsdata *vd, int *error)
int getMinorVersionNumber(void)
void VOMS_DeleteContacts(struct contactdata **list)
int VOMS_RetrieveFromAC(AC *ac, struct vomsdata *vd, int *error)
int VOMS_SetTimeout(int t, struct vomsdata *vd, int *error)
int getPatchVersionNumber(void)
int VOMS_GetAttributesNumber(struct voms *v, int handle, struct vomsdata *vd, int *error)
int VOMS_Import(char *buffer, int buflen, struct vomsdata *vd, int *error)
char * VOMS_ListTargets(struct vomsdata *vd, int *error)
void * gss_cred_id_t
Definition voms_apic.h:34
int VOMS_RetrieveFromCred(gss_cred_id_t cred, int how, struct vomsdata *vd, int *error)
int VOMS_RetrieveFromCtx(gss_ctx_id_t ctx, int how, struct vomsdata *vd, int *error)
int VOMS_GetAttribute(struct voms *v, int handle, int num, struct attribute *at, struct vomsdata *vd, int *error)
int VOMS_Export(char **buffer, int *buflen, struct vomsdata *vd, int *error)
int VOMS_SetVerificationTime(time_t verificationtime, struct vomsdata *vd, int *error)
struct voms * VOMS_Copy(struct voms *v, int *error)
AC * VOMS_GetAC(struct voms *v)
int VOMS_ContactRaw(char *hostname, int port, char *servsubject, char *command, void **data, int *datalen, int *version, struct vomsdata *vd, int *error)
int VOMS_GetAttributeSourceHandle(struct voms *v, int num, struct vomsdata *vd, int *error)
int VOMS_GetAttributeSourcesNumber(struct voms *v, struct vomsdata *vd, int *error)
void * gss_ctx_id_t
Definition voms_apic.h:35
int VOMS_Contact(char *hostname, int port, char *servsubject, char *command, struct vomsdata *vd, int *error)
int VOMS_RetrieveFromProxy(int how, struct vomsdata *vd, int *error)
int VOMS_Retrieve(X509 *cert, STACK_OF(X509) *chain, int how, struct vomsdata *vd, int *error)
void VOMS_Destroy(struct vomsdata *vd)
char * VOMS_ErrorMessage(struct vomsdata *vd, int error, char *buffer, int len)
int VOMS_AddTarget(struct vomsdata *vd, char *target, int *error)
void VOMS_FreeTargetsList(char **)
int VOMS_Ordering(char *order, struct vomsdata *vd, int *error)
void VOMS_Delete(struct voms *v)
int VOMS_SetLifetime(int length, struct vomsdata *vd, int *error)
struct vomsdata * VOMS_Init(char *voms, char *cert)
void VOMS_FreeTargets(struct vomsdata *vd, int *error)
struct contactdata ** VOMS_FindByVO(struct vomsdata *vd, char *vo, char *system, char *user, int *error)
struct voms * VOMS_DefaultData(struct vomsdata *vd, int *error)
int VOMS_SetVerificationType(int type, struct vomsdata *vd, int *error)