00001
00002 #ifndef __CRYPTO_LOCALCIPHER_H__
00003 #define __CRYPTO_LOCALCIPHER_H__
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <XrdCrypto/XrdCryptoCipher.hh>
00021
00022
00023
00024
00025
00026
00027 class XrdCryptolocalCipher : public XrdCryptoCipher
00028 {
00029 private:
00030 bool valid;
00031 unsigned char *bpub;
00032 unsigned char *bpriv;
00033
00034 public:
00035 XrdCryptolocalCipher(const char *t = "PC1", int l = 0);
00036 XrdCryptolocalCipher(const char *t, int l, const char *k);
00037 XrdCryptolocalCipher(XrdSutBucket *b);
00038 XrdCryptolocalCipher(int len, char *pub, int lpub, const char *t = "PC1");
00039 XrdCryptolocalCipher(const XrdCryptolocalCipher &c);
00040 virtual ~XrdCryptolocalCipher() { Cleanup(); }
00041
00042
00043 bool Finalize(char *pub, int lpub, const char *t = "PC1");
00044 void Cleanup();
00045
00046
00047 bool IsValid() { return valid; }
00048
00049
00050 XrdSutBucket *AsBucket();
00051 bool IsDefaultLength() const;
00052 char *Public(int &lpub);
00053
00054
00055 int EncOutLength(int l);
00056 int DecOutLength(int l);
00057
00058
00059 int Encrypt(const char *in, int lin, char *out);
00060 int Decrypt(const char *in, int lin, char *out);
00061 };
00062
00063 #endif