Loading...
Searching...
No Matches
voms_apic.h
Go to the documentation of this file.
/*********************************************************************
*
* Authors: Vincenzo Ciaschini - Vincenzo.Ciaschini@cnaf.infn.it
*
* Copyright (c) Members of the EGEE Collaboration. 2004-2010.
* See http://www.eu-egee.org/partners/ for details on the copyright holders.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Parts of this code may be based upon or even include verbatim pieces,
* originally written by other people, in which case the original header
* follows.
*
*********************************************************************/
#ifndef VOMS_APIC_H
#define VOMS_APIC_H
#ifdef __cplusplus
extern "C" {
#endif
#define NOGLOBUS
#if !(defined(GSSAPI_H_) || defined(_GSSAPI_H) || defined(_GSSAPI_H_))
typedef void * gss_cred_id_t;
typedef void * gss_ctx_id_t;
#endif
#include <openssl/x509.h>
#include <time.h>
#include "newformat.h"
/*#include "voms_api.h"*/
struct data {
char *group;
char *role;
char *cap;
};
struct attribute {
const char *name;
const char *value;
const char *qualifier;
};
struct contactdata {
char *nick;
char *host;
char *contact;
char *vo;
int port;
char *reserved;
int version;
};
#define TYPE_NODATA 0
#define TYPE_STD 1
#define TYPE_CUSTOM 2
struct voms {
int siglen;
char *signature;
char *user;
char *userca;
char *server;
char *serverca;
char *voname;
char *uri;
char *date1;
char *date2;
int type;
struct data **std;
char *custom;
int datalen;
int version;
char **fqan;
char *serial;
/* Fields below this line are reserved. */
AC *ac;
X509 *holder;
};
#define RECURSE_CHAIN 0
#define RECURSE_NONE 1
#define VERIFY_FULL 0xffffffff
#define VERIFY_NONE 0x00000000
#define VERIFY_DATE 0x00000001
#define VERIFY_NOTARGET 0x00000002
#define VERIFY_KEY 0x00000004
#define VERIFY_SIGN 0x00000008
#define VERIFY_ORDER 0x00000010
#define VERIFY_ID 0x00000020
#define VERIFY_CERTLIST 0x00000040
#define VERR_NONE 0
#define VERR_NOSOCKET 1
#define VERR_NOIDENT 2
#define VERR_COMM 3
#define VERR_PARAM 4
#define VERR_NOEXT 5
#define VERR_NOINIT 6
#define VERR_TIME 7
#define VERR_IDCHECK 8
#define VERR_EXTRAINFO 9
#define VERR_FORMAT 10
#define VERR_NODATA 11
#define VERR_PARSE 12
#define VERR_DIR 13
#define VERR_SIGN 14
#define VERR_SERVER 15
#define VERR_MEM 16
#define VERR_VERIFY 17
#define VERR_TYPE 18
#define VERR_ORDER 19
#define VERR_SERVERCODE 20
#define VERR_NOTAVAIL 21
struct vomsdata {
char *cdir;
char *vdir;
struct voms **data;
char *workvo;
char *extra_data;
int volen;
int extralen;
/* Fields below this line are reserved. */
struct vomsdata *real;
};
extern struct contactdata **VOMS_FindByAlias(struct vomsdata *vd, char *alias,
char *system, char *user,
int *error);
extern struct contactdata **VOMS_FindByVO(struct vomsdata *vd, char *vo,
char *system, char *user,
int *error);
extern void VOMS_DeleteContacts(struct contactdata **list);
extern struct vomsdata *VOMS_Init(char *voms, char *cert);
extern struct voms *VOMS_Copy(struct voms *v, int *error);
extern struct vomsdata *VOMS_CopyAll(struct vomsdata *vd, int *error);
extern void VOMS_Delete(struct voms *v);
extern int VOMS_AddTarget(struct vomsdata *vd, char *target, int *error);
extern void VOMS_FreeTargets(struct vomsdata *vd, int *error);
extern char *VOMS_ListTargets(struct vomsdata *vd, int *error); /*< Gets the list of targets for the AC.
\param vd The vomsdata structure.
\param error RETURN PARAMETER: qualifies the error message. */
extern int VOMS_SetVerificationType(int type, struct vomsdata *vd, int *error); /* Sets the verification type.
\param type. The verification type.
\param vd The vomsdata structure.
\param error RETURN PARAMETER: qualifies the error message. */
extern int VOMS_SetLifetime(int length, struct vomsdata *vd,
int *error);
extern void VOMS_Destroy(struct vomsdata *vd);
extern int VOMS_ResetOrder(struct vomsdata *vd, int *error);
extern int VOMS_Ordering(char *order, struct vomsdata *vd, int *error);
extern int VOMS_Contact(char *hostname, int port, char *servsubject,
char *command, struct vomsdata *vd, int *error);
extern int VOMS_ContactRaw(char *hostname, int port, char *servsubject,
char *command, void **data, int *datalen, int *version,
struct vomsdata *vd, int *error);
extern int VOMS_Retrieve(X509 *cert, STACK_OF(X509) *chain, int how,
struct vomsdata *vd, int *error);
extern int VOMS_Import(char *buffer, int buflen, struct vomsdata *vd, int *error);
extern int VOMS_Export(char **buffer, int *buflen, struct vomsdata *vd, int *error);
extern struct voms *VOMS_DefaultData(struct vomsdata *vd, int *error);
extern char *VOMS_ErrorMessage(struct vomsdata *vd, int error, char *buffer, int len);
extern int VOMS_RetrieveEXT(X509_EXTENSION *ext, struct vomsdata *vd, int *error);
extern int VOMS_RetrieveFromCred(gss_cred_id_t cred, int how, struct vomsdata *vd, int *error);
extern int VOMS_RetrieveFromFile(FILE *file, int how, struct vomsdata *vd, int *error);
extern int VOMS_RetrieveFromCtx(gss_ctx_id_t ctx, int how, struct vomsdata *vd, int *error);
extern int VOMS_RetrieveFromProxy(int how, struct vomsdata *vd, int *error);
extern int VOMS_RetrieveFromAC(AC*ac, struct vomsdata *vd, int *error);
extern int VOMS_GetAttributeSourcesNumber(struct voms *v, struct vomsdata *vd, int *error);
extern int VOMS_GetAttributeSourceHandle(struct voms *v, int num, struct vomsdata *vd, int *error);
extern const char *VOMS_GetAttributeGrantor(struct voms *v, int handle, struct vomsdata *vd, int *error);
extern int VOMS_GetAttributesNumber(struct voms *v, int handle, struct vomsdata *vd, int *error);
extern int VOMS_GetAttribute(struct voms *v, int handle, int num, struct attribute *at, struct vomsdata *vd, int *error);
extern struct vomsdata *VOMS_Duplicate(struct vomsdata *vd);
extern AC *VOMS_GetAC(struct voms *v);
extern int getMajorVersionNumber(void);
extern int getMinorVersionNumber(void);
extern int getPatchVersionNumber(void);
extern int VOMS_SetVerificationTime(time_t verificationtime, struct vomsdata *vd, int *error);
extern char **VOMS_GetTargetsList(struct voms *v, struct vomsdata *vd, int *error);
extern void VOMS_FreeTargetsList(char **);
extern int VOMS_SetTimeout(int t, struct vomsdata *vd, int *error);
extern int VOMS_LoadCredentials(X509 *cert, EVP_PKEY *pkey, STACK_OF(X509)* chain, struct vomsdata *vd, int *error);
#ifdef __cplusplus
}
#endif
#endif
attribute
Definition voms_apic.h:54
attribute::value
const char * value
Definition voms_apic.h:56
attribute::name
const char * name
Definition voms_apic.h:55
attribute::qualifier
const char * qualifier
Definition voms_apic.h:57
contactdata
The type of data returned.
Definition voms_apic.h:60
contactdata::vo
char * vo
Definition voms_apic.h:66
contactdata::port
int port
Definition voms_apic.h:67
contactdata::nick
char * nick
Definition voms_apic.h:63
contactdata::host
char * host
Definition voms_apic.h:64
contactdata::version
int version
Definition voms_apic.h:69
contactdata::contact
char * contact
Definition voms_apic.h:65
contactdata::reserved
char * reserved
Definition voms_apic.h:68
data
User's characteristics: can be repeated.
Definition voms_apic.h:48
data::cap
char * cap
Definition voms_apic.h:51
data::group
char * group
Definition voms_apic.h:49
data::role
char * role
Definition voms_apic.h:50
voms
Definition voms_apic.h:80
voms::signature
char * signature
Definition voms_apic.h:82
voms::date1
char * date1
Definition voms_apic.h:89
voms::user
char * user
Definition voms_apic.h:83
voms::datalen
int datalen
Definition voms_apic.h:94
voms::server
char * server
Definition voms_apic.h:85
voms::version
int version
Definition voms_apic.h:95
voms::siglen
int siglen
Definition voms_apic.h:81
voms::type
int type
Definition voms_apic.h:91
voms::custom
char * custom
Definition voms_apic.h:93
voms::voname
char * voname
Definition voms_apic.h:87
voms::ac
AC * ac
Definition voms_apic.h:100
voms::date2
char * date2
Definition voms_apic.h:90
voms::serverca
char * serverca
Definition voms_apic.h:86
voms::uri
char * uri
Definition voms_apic.h:88
voms::fqan
char ** fqan
Definition voms_apic.h:96
voms::serial
char * serial
Definition voms_apic.h:97
voms::holder
X509 * holder
Definition voms_apic.h:101
voms::std
struct data ** std
Definition voms_apic.h:92
voms::userca
char * userca
Definition voms_apic.h:84
vomsdata
Definition voms_apic.h:144
vomsdata::cdir
char * cdir
Definition voms_apic.h:145
vomsdata::real
struct vomsdata * real
Definition voms_apic.h:164
vomsdata::vdir
char * vdir
Definition voms_apic.h:146
vomsdata::volen
int volen
Definition voms_apic.h:161
vomsdata::extra_data
char * extra_data
Definition voms_apic.h:152
vomsdata::data
struct voms ** data
Definition voms_apic.h:147
vomsdata::extralen
int extralen
Definition voms_apic.h:162
vomsdata::workvo
char * workvo
Definition voms_apic.h:150
VOMS_Duplicate
struct vomsdata * VOMS_Duplicate(struct vomsdata *vd)
VOMS_FindByAlias
struct contactdata ** VOMS_FindByAlias(struct vomsdata *vd, char *alias, char *system, char *user, int *error)
VOMS_CopyAll
struct vomsdata * VOMS_CopyAll(struct vomsdata *vd, int *error)
VOMS_GetAttributeGrantor
const char * VOMS_GetAttributeGrantor(struct voms *v, int handle, struct vomsdata *vd, int *error)
VOMS_GetTargetsList
char ** VOMS_GetTargetsList(struct voms *v, struct vomsdata *vd, int *error)
VOMS_RetrieveFromFile
int VOMS_RetrieveFromFile(FILE *file, int how, struct vomsdata *vd, int *error)
VOMS_LoadCredentials
int VOMS_LoadCredentials(X509 *cert, EVP_PKEY *pkey, STACK_OF(X509) *chain, struct vomsdata *vd, int *error)
getMajorVersionNumber
int getMajorVersionNumber(void)
VOMS_ResetOrder
int VOMS_ResetOrder(struct vomsdata *vd, int *error)
VOMS_RetrieveEXT
int VOMS_RetrieveEXT(X509_EXTENSION *ext, struct vomsdata *vd, int *error)
getMinorVersionNumber
int getMinorVersionNumber(void)
VOMS_DeleteContacts
void VOMS_DeleteContacts(struct contactdata **list)
VOMS_RetrieveFromAC
int VOMS_RetrieveFromAC(AC *ac, struct vomsdata *vd, int *error)
VOMS_SetTimeout
int VOMS_SetTimeout(int t, struct vomsdata *vd, int *error)
getPatchVersionNumber
int getPatchVersionNumber(void)
VOMS_GetAttributesNumber
int VOMS_GetAttributesNumber(struct voms *v, int handle, struct vomsdata *vd, int *error)
VOMS_Import
int VOMS_Import(char *buffer, int buflen, struct vomsdata *vd, int *error)
VOMS_ListTargets
char * VOMS_ListTargets(struct vomsdata *vd, int *error)
gss_cred_id_t
void * gss_cred_id_t
Definition voms_apic.h:35
VOMS_RetrieveFromCred
int VOMS_RetrieveFromCred(gss_cred_id_t cred, int how, struct vomsdata *vd, int *error)
VOMS_RetrieveFromCtx
int VOMS_RetrieveFromCtx(gss_ctx_id_t ctx, int how, struct vomsdata *vd, int *error)
VOMS_GetAttribute
int VOMS_GetAttribute(struct voms *v, int handle, int num, struct attribute *at, struct vomsdata *vd, int *error)
VOMS_Export
int VOMS_Export(char **buffer, int *buflen, struct vomsdata *vd, int *error)
VOMS_SetVerificationTime
int VOMS_SetVerificationTime(time_t verificationtime, struct vomsdata *vd, int *error)
VOMS_Copy
struct voms * VOMS_Copy(struct voms *v, int *error)
VOMS_GetAC
AC * VOMS_GetAC(struct voms *v)
VOMS_ContactRaw
int VOMS_ContactRaw(char *hostname, int port, char *servsubject, char *command, void **data, int *datalen, int *version, struct vomsdata *vd, int *error)
VOMS_GetAttributeSourceHandle
int VOMS_GetAttributeSourceHandle(struct voms *v, int num, struct vomsdata *vd, int *error)
VOMS_GetAttributeSourcesNumber
int VOMS_GetAttributeSourcesNumber(struct voms *v, struct vomsdata *vd, int *error)
gss_ctx_id_t
void * gss_ctx_id_t
Definition voms_apic.h:36
VOMS_Contact
int VOMS_Contact(char *hostname, int port, char *servsubject, char *command, struct vomsdata *vd, int *error)
VOMS_RetrieveFromProxy
int VOMS_RetrieveFromProxy(int how, struct vomsdata *vd, int *error)
VOMS_Retrieve
int VOMS_Retrieve(X509 *cert, STACK_OF(X509) *chain, int how, struct vomsdata *vd, int *error)
VOMS_Destroy
void VOMS_Destroy(struct vomsdata *vd)
VOMS_ErrorMessage
char * VOMS_ErrorMessage(struct vomsdata *vd, int error, char *buffer, int len)
VOMS_AddTarget
int VOMS_AddTarget(struct vomsdata *vd, char *target, int *error)
VOMS_FreeTargetsList
void VOMS_FreeTargetsList(char **)
VOMS_Ordering
int VOMS_Ordering(char *order, struct vomsdata *vd, int *error)
VOMS_Delete
void VOMS_Delete(struct voms *v)
VOMS_SetLifetime
int VOMS_SetLifetime(int length, struct vomsdata *vd, int *error)
VOMS_Init
struct vomsdata * VOMS_Init(char *voms, char *cert)
VOMS_FreeTargets
void VOMS_FreeTargets(struct vomsdata *vd, int *error)
VOMS_FindByVO
struct contactdata ** VOMS_FindByVO(struct vomsdata *vd, char *vo, char *system, char *user, int *error)
VOMS_DefaultData
struct voms * VOMS_DefaultData(struct vomsdata *vd, int *error)
VOMS_SetVerificationType
int VOMS_SetVerificationType(int type, struct vomsdata *vd, int *error)