00001
00002 #ifndef __CRYPTO_SSLRSA_H__
00003 #define __CRYPTO_SSLRSA_H__
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <XrdCrypto/XrdCryptoRSA.hh>
00021
00022 #include <openssl/evp.h>
00023
00024
00025
00026
00027
00028
00029 class XrdCryptosslRSA : public XrdCryptoRSA
00030 {
00031 private:
00032 EVP_PKEY *fEVP;
00033 int publen;
00034 int prilen;
00035
00036 public:
00037 XrdCryptosslRSA(int bits = XrdCryptoMinRSABits, int exp = XrdCryptoDefRSAExp);
00038 XrdCryptosslRSA(const char *pub, int lpub = 0);
00039 XrdCryptosslRSA(EVP_PKEY *key, bool check = 1);
00040 XrdCryptosslRSA(const XrdCryptosslRSA &r);
00041 virtual ~XrdCryptosslRSA();
00042
00043
00044 XrdCryptoRSAdata Opaque() { return fEVP; }
00045
00046
00047 void Dump();
00048
00049
00050 int GetOutlen(int lin);
00051 int GetPublen();
00052 int GetPrilen();
00053
00054
00055 int ImportPublic(const char *in, int lin);
00056 int ExportPublic(char *out, int lout);
00057 int ImportPrivate(const char *in, int lin);
00058 int ExportPrivate(char *out, int lout);
00059
00060
00061 int EncryptPrivate(const char *in, int lin, char *out, int lout);
00062 int DecryptPublic(const char *in, int lin, char *out, int lout);
00063 int EncryptPublic(const char *in, int lin, char *out, int lout);
00064 int DecryptPrivate(const char *in, int lin, char *out, int lout);
00065 };
00066
00067 #endif