openssl_cipher_property.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/evp.h>
00018 #include<oxs_buffer.h>
00019 
00024 #ifndef OPENSSL_CIPHER_PROPERTY_H
00025 #define OPENSSL_CIPHER_PROPERTY_H
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 
00033     typedef struct openssl_cipher_property_ops openssl_cipher_property_ops_t;
00034 
00036     typedef struct openssl_cipher_property openssl_cipher_property_t;
00037 
00038     struct openssl_cipher_property_ops
00039     {
00040         EVP_CIPHER *(AXIS2_CALL *
00041                 get_cipher)(
00042                     const openssl_cipher_property_t *cprop,
00043                     const axis2_env_t *env);
00044 
00045         axis2_char_t *(AXIS2_CALL *
00046                 get_name)(
00047                     const openssl_cipher_property_t *cprop,
00048                     const axis2_env_t *env);
00049 
00050         axis2_char_t *(AXIS2_CALL *
00051                 get_url)(
00052                     const openssl_cipher_property_t *cprop,
00053                     const axis2_env_t *env);
00054 
00055         int (AXIS2_CALL *
00056                 get_key_size)(
00057                     const openssl_cipher_property_t *cprop,
00058                     const axis2_env_t *env);
00059 
00060         int (AXIS2_CALL *
00061                 get_block_size)(
00062                     const openssl_cipher_property_t *cprop,
00063                     const axis2_env_t *env);
00064 
00065         int (AXIS2_CALL *
00066                 get_iv_size)(
00067                     const openssl_cipher_property_t *cprop,
00068                     const axis2_env_t *env);
00069     
00070         axis2_status_t (AXIS2_CALL *
00071                 set_cipher)(
00072                     const openssl_cipher_property_t *cprop,
00073                     const axis2_env_t *env,
00074                     EVP_CIPHER *cipher);
00075 
00076         axis2_status_t (AXIS2_CALL *
00077                 set_name)(
00078                     const openssl_cipher_property_t *cprop,
00079                     const axis2_env_t *env,
00080                     axis2_char_t *name);
00081 
00082         axis2_status_t (AXIS2_CALL *
00083                 set_url)(
00084                     const openssl_cipher_property_t *cprop,
00085                     const axis2_env_t *env,
00086                     axis2_char_t *url);
00087 
00088         axis2_status_t (AXIS2_CALL *
00089                 set_key_size)(
00090                     const openssl_cipher_property_t *cprop,
00091                     const axis2_env_t *env,
00092                     int key_size);
00093 
00094         axis2_status_t (AXIS2_CALL *
00095                 set_block_size)(
00096                     const openssl_cipher_property_t *cprop,
00097                     const axis2_env_t *env,
00098                     int block_size);
00099 
00100         axis2_status_t (AXIS2_CALL *
00101                 set_iv_size)(
00102                     const openssl_cipher_property_t *cprop,
00103                     const axis2_env_t *env,
00104                     int iv_size);
00105  
00106         axis2_status_t (AXIS2_CALL *
00107                 free)(
00108                     openssl_cipher_property_t *cprop,
00109                     const axis2_env_t *env);
00110 
00111     };
00112 
00113     struct openssl_cipher_property
00114     {
00115         openssl_cipher_property_ops_t *ops;    
00116     };
00117 
00122 AXIS2_EXTERN openssl_cipher_property_t *AXIS2_CALL
00123 openssl_cipher_property_create(const axis2_env_t *env);
00124 
00125 /******** Macros ***************/
00126 
00127 #define OPENSSL_CIPHER_PROPERTY_GET_CIPHER(cprop, env)\
00128     ((cprop)->ops->get_cipher(cprop, env))
00129 
00130 #define OPENSSL_CIPHER_PROPERTY_GET_NAME(cprop, env)\
00131     ((cprop)->ops->get_name(cprop, env))
00132 
00133 #define OPENSSL_CIPHER_PROPERTY_GET_URL(cprop, env)\
00134     ((cprop)->ops->get_url(cprop, env))
00135 
00136 #define OPENSSL_CIPHER_PROPERTY_GET_KEY_SIZE(cprop, env)\
00137     ((cprop)->ops->get_key_size(cprop, env))
00138 
00139 #define OPENSSL_CIPHER_PROPERTY_GET_BLOCK_SIZE(cprop, env)\
00140     ((cprop)->ops->get_block_size(cprop, env))
00141 
00142 #define OPENSSL_CIPHER_PROPERTY_GET_IV_SIZE(cprop, env)\
00143     ((cprop)->ops->get_iv_size(cprop, env))
00144 
00145 #define OPENSSL_CIPHER_PROPERTY_SET_CIPHER(cprop, env, cipher)\
00146     ((cprop)->ops->set_cipher(cprop, env, cipher))
00147 
00148 #define OPENSSL_CIPHER_PROPERTY_SET_NAME(cprop, env, name)\
00149     ((cprop)->ops->set_name(cprop, env, name))
00150 
00151 #define OPENSSL_CIPHER_PROPERTY_SET_URL(cprop, env, url)\
00152     ((cprop)->ops->set_url(cprop, env, url))
00153 
00154 #define OPENSSL_CIPHER_PROPERTY_SET_KEY_SIZE(cprop, env, key_size)\
00155     ((cprop)->ops->set_key_size(cprop, env, key_size))
00156 
00157 #define OPENSSL_CIPHER_PROPERTY_SET_BLOCK_SIZE(cprop, env, block_size)\
00158     ((cprop)->ops->set_block_size(cprop, env, block_size))
00159 
00160 #define OPENSSL_CIPHER_PROPERTY_SET_IV_SIZE(cprop, env, iv_size)\
00161     ((cprop)->ops->set_iv_size(cprop, env, iv_size))
00162 
00163 #define OPENSSL_CIPHER_PROPERTY_FREE(cprop, env)\
00164     ((cprop)->ops->free(cprop, env))
00165 
00166 /* @} */
00167 #ifdef __cplusplus
00168 }
00169 #endif
00170 
00171 #endif    /* OPENSSL_CIPHER_PROPERTY_H */

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