00001 /******************************************************************************/ 00002 /* */ 00003 /* X r d C r y p t o L i t e . c c */ 00004 /* */ 00005 /* (c) 2008 by the Board of Trustees of the Leland Stanford, Jr., University */ 00006 /* All Rights Reserved */ 00007 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00008 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00009 /******************************************************************************/ 00010 00011 // $Id: XrdCryptoLite.cc 30949 2009-11-02 16:37:58Z ganis $ 00012 00013 const char *XrdCryptoLiteCVSID = "$Id: XrdCryptoLite.cc 30949 2009-11-02 16:37:58Z ganis $"; 00014 00015 #include <errno.h> 00016 #include <string.h> 00017 00018 #include "XrdCrypto/XrdCryptoLite.hh" 00019 00020 /******************************************************************************/ 00021 /* C r e a t e */ 00022 /******************************************************************************/ 00023 00024 /* This is simply a landing pattern for all supported crypto methods; to avoid 00025 requiring the client to include specific implementation include files. Add 00026 your implementation in the following way: 00027 1. Define an external function who's signature follows: 00028 XrdCryptoLite *XrdCryptoLite_New_xxxx(const char Type) 00029 where 'xxxx' corresponds to the passed Name argument. 00030 2. Insert the extern to the function. 00031 3. Insert the code segment that calls the function. 00032 */ 00033 00034 XrdCryptoLite *XrdCryptoLite::Create(int &rc, const char *Name, const char Type) 00035 { 00036 extern XrdCryptoLite *XrdCryptoLite_New_bf32(const char Type); 00037 XrdCryptoLite *cryptoP = 0; 00038 00039 if (!strcmp(Name, "bf32")) cryptoP = XrdCryptoLite_New_bf32(Type); 00040 00041 // Return appropriately 00042 // 00043 rc = (cryptoP ? 0 : EPROTONOSUPPORT); 00044 return cryptoP; 00045 }