00001
00002 #ifndef __CRYPTO_SSLFACTORY_H__
00003 #define __CRYPTO_SSLFACTORY_H__
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CRYPTO_FACTORY_H__
00021 #include "XrdCrypto/XrdCryptoFactory.hh"
00022 #endif
00023
00024 #include "XrdSys/XrdSysPthread.hh"
00025
00026 int DebugON = 1;
00027
00028
00029 #define XrdCryptosslFactoryID 1
00030
00031 #define SSLFACTORY_MAX_CRYPTO_MUTEX 256
00032
00033 class XrdCryptosslFactory : public XrdCryptoFactory
00034 {
00035 public:
00036 XrdCryptosslFactory();
00037 virtual ~XrdCryptosslFactory() { }
00038
00039
00040 void SetTrace(kXR_int32 trace);
00041
00042
00043 XrdCryptoKDFunLen_t KDFunLen();
00044 XrdCryptoKDFun_t KDFun();
00045
00046
00047 bool SupportedCipher(const char *t);
00048 XrdCryptoCipher *Cipher(const char *t, int l = 0);
00049 XrdCryptoCipher *Cipher(const char *t, int l, const char *k,
00050 int liv, const char *iv);
00051 XrdCryptoCipher *Cipher(XrdSutBucket *b);
00052 XrdCryptoCipher *Cipher(int bits, char *pub, int lpub, const char *t = 0);
00053 XrdCryptoCipher *Cipher(const XrdCryptoCipher &c);
00054
00055
00056 bool SupportedMsgDigest(const char *dgst);
00057 XrdCryptoMsgDigest *MsgDigest(const char *dgst);
00058
00059
00060 XrdCryptoRSA *RSA(int bits = XrdCryptoDefRSABits, int exp = XrdCryptoDefRSAExp);
00061 XrdCryptoRSA *RSA(const char *pub, int lpub = 0);
00062 XrdCryptoRSA *RSA(const XrdCryptoRSA &r);
00063
00064
00065 XrdCryptoX509 *X509(const char *cf, const char *kf = 0);
00066 XrdCryptoX509 *X509(XrdSutBucket *b);
00067
00068
00069 XrdCryptoX509Crl *X509Crl(const char *crlfile, int opt = 0);
00070 XrdCryptoX509Crl *X509Crl(XrdCryptoX509 *cacert);
00071
00072
00073 XrdCryptoX509Req *X509Req(XrdSutBucket *bck);
00074
00075
00076 XrdCryptoX509VerifyCert_t X509VerifyCert();
00077 XrdCryptoX509VerifyChain_t X509VerifyChain();
00078 XrdCryptoX509ParseFile_t X509ParseFile();
00079 XrdCryptoX509ParseBucket_t X509ParseBucket();
00080 XrdCryptoX509ExportChain_t X509ExportChain();
00081 XrdCryptoX509ChainToFile_t X509ChainToFile();
00082
00083
00084 static XrdSysMutex* CryptoMutexPool[SSLFACTORY_MAX_CRYPTO_MUTEX];
00085
00086 };
00087
00088 #endif