openssl_rsa.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
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     /*Create function*/
00106     AXIS2_EXTERN openssl_rsa_t *AXIS2_CALL
00107     openssl_rsa_create(const axis2_env_t *env);
00108 
00109 /**********************Macros******************************************/
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    /* OPENSSL_RSA_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1