00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <openssl/rand.h>
00018 #include <openssl/evp.h>
00019 #include <openssl/pem.h>
00020 #include <openssl/bio.h>
00021 #include <openssl/rand.h>
00022 #include <openssl_constants.h>
00023 #include <openssl_pkey.h>
00024 #include <axis2_util.h>
00025 #include <oxs_buffer.h>
00026
00031 #ifndef OPENSSL_RSA_H
00032 #define OPENSSL_RSA_H
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00044 typedef struct openssl_rsa_ops openssl_rsa_ops_t;
00046 typedef struct openssl_rsa openssl_rsa_t;
00047
00048
00049 struct openssl_rsa_ops
00050 {
00051
00059 axis2_status_t (AXIS2_CALL *
00060 free)(
00061 openssl_rsa_t *rsa,
00062 const axis2_env_t *env);
00063
00073 int (AXIS2_CALL *
00074 prv_decrypt)(
00075 openssl_rsa_t *rsa,
00076 const axis2_env_t *env,
00077 const openssl_pkey_t *pkey,
00078 oxs_buffer_t *in,
00079 oxs_buffer_t *out );
00080
00090 int (AXIS2_CALL*
00091 pub_encrypt)(
00092 openssl_rsa_t *rsa,
00093 const axis2_env_t *env,
00094 const openssl_pkey_t *pkey,
00095 oxs_buffer_t *in,
00096 oxs_buffer_t *out );
00097 };
00098
00099 struct openssl_rsa
00100 {
00102 openssl_rsa_ops_t *ops;
00103 };
00104
00105
00106 AXIS2_EXTERN openssl_rsa_t *AXIS2_CALL
00107 openssl_rsa_create(const axis2_env_t *env);
00108
00109
00110 #define OPENSSL_RSA_FREE(rsa, env) \
00111 ((rsa)->ops->free(rsa, env) )
00112
00113 #define OPENSSL_RSA_PRV_DECRYPT(rsa, env, pkey, in, out) \
00114 ((rsa)->ops->prv_decrypt(rsa, env, pkey, in, out) )
00115
00116 #define OPENSSL_RSA_PUB_ENCRYPT(rsa, env, pkey, in, out) \
00117 ((rsa)->ops->pub_encrypt(rsa, env, pkey, in, out) )
00118
00119
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124
00125 #endif