00001 // @(#)root/auth:$Id: AFSAuth.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: G. Ganis, Nov 2006 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_AFSAuth 00013 #define ROOT_AFSAuth 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // AFSAuth // 00019 // // 00020 // Utility functions to acquire and handle AFS tokens. // 00021 // These functions are available as separate plugin, libAFSAuth.so, // 00022 // depending aonly on the AFS libraries. // 00023 // // 00024 ////////////////////////////////////////////////////////////////////////// 00025 00026 // One day as default lifetime 00027 #define DFLTTOKENLIFETIME (24*3600) 00028 00029 extern "C" { 00030 // Get AFS token for the local cell for 'usr'. The meaning of the 00031 // information passed at 'pwd' depends on 'pwlen'. For 'pwlen <= 0' 00032 // 'pwd' is interpreted as the plain password (null terminated string). 00033 // For 'pwlen > 0', the 'pwlen' bytes at 'pwd' contain the password in 00034 // for of encryption key (struct ktc_encryptionKey). 00035 // On success a token is returned as opaque information. 00036 // On error / failure, 0 is returned; if emsg != 0, *emsg points to an 00037 // error message. 00038 void *GetAFSToken(const char *usr, 00039 const char *pwd, int pwlen = -1, 00040 int life = DFLTTOKENLIFETIME, char **emsg = 0); 00041 00042 // Verify validity an AFS token. The opaque input information is the one 00043 // returned by a successful call to GetAFSToken. 00044 // The remaining lifetime is returned, i.e. <=0 if expired. 00045 int VerifyAFSToken(void *token); 00046 00047 // Delete an AFS token returned by a successful call to GetAFSToken. 00048 void DeleteAFSToken(void *token); 00049 00050 // Returns a pointer to a string with the local cell. The string must 00051 // not be freed or deleted. 00052 char *AFSLocalCell(); 00053 00054 } 00055 #endif 00056