xrootd
XrdCryptolocalFactory.hh
Go to the documentation of this file.
00001 #ifndef __CRYPTO_LOCALFACTORY_H__
00002 #define __CRYPTO_LOCALFACTORY_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*             X r d C r y p t o L o c a l F a c t o r y . h h                */
00006 /*                                                                            */
00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*   Produced by Gerri Ganis for CERN                                         */
00009 /*                                                                            */
00010 /* This file is part of the XRootD software suite.                            */
00011 /*                                                                            */
00012 /* XRootD is free software: you can redistribute it and/or modify it under    */
00013 /* the terms of the GNU Lesser General Public License as published by the     */
00014 /* Free Software Foundation, either version 3 of the License, or (at your     */
00015 /* option) any later version.                                                 */
00016 /*                                                                            */
00017 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00018 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00019 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00020 /* License for more details.                                                  */
00021 /*                                                                            */
00022 /* You should have received a copy of the GNU Lesser General Public License   */
00023 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00024 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00025 /*                                                                            */
00026 /* The copyright holder's institutional names and contributor's names may not */
00027 /* be used to endorse or promote products derived from this software without  */
00028 /* specific prior written permission of the institution or contributor.       */
00029 /******************************************************************************/
00030 
00031 /* ************************************************************************** */
00032 /*                                                                            */
00033 /* Implementation of the local crypto factory                                 */
00034 /*                                                                            */
00035 /* ************************************************************************** */
00036 
00037 #include "XrdCrypto/XrdCryptoFactory.hh"
00038 
00039 // The ID must be a unique number
00040 #define XrdCryptolocalFactoryID  0
00041 
00042 class XrdCryptolocalFactory : public XrdCryptoFactory 
00043 {
00044 public:
00045    XrdCryptolocalFactory();
00046    virtual ~XrdCryptolocalFactory() { }
00047 
00048    // Set trace flags
00049    void SetTrace(kXR_int32 trace);
00050 
00051    // Hook to local KDFun
00052    XrdCryptoKDFunLen_t KDFunLen(); // Length of buffer
00053    XrdCryptoKDFun_t KDFun();
00054 
00055    // Cipher constructors
00056    XrdCryptoCipher *Cipher(const char *t, int l = 0);
00057    XrdCryptoCipher *Cipher(const char *t, int l, const char *k,
00058                                           int liv, const char *iv);
00059    XrdCryptoCipher *Cipher(XrdSutBucket *b);
00060    XrdCryptoCipher *Cipher(int bits, char *pub, int lpub, const char *t = 0);
00061    XrdCryptoCipher *Cipher(const XrdCryptoCipher &c);
00062 
00063    // MsgDigest constructors
00064    XrdCryptoMsgDigest *MsgDigest(const char *dgst);
00065 
00066    // RSA constructors
00067    XrdCryptoRSA *RSA(int bits = XrdCryptoDefRSABits, int exp = XrdCryptoDefRSAExp);
00068    XrdCryptoRSA *RSA(const char *pub, int lpub = 0);
00069    XrdCryptoRSA *RSA(const XrdCryptoRSA &r);
00070 };
00071 
00072 #endif