00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef OXS_KEY_H
00019 #define OXS_KEY_H
00020
00021
00032 #include <axis2_defines.h>
00033 #include <oxs_constants.h>
00034 #include <oxs_buffer.h>
00035 #include <axutil_env.h>
00036
00037 #ifdef __cplusplus
00038 extern "C"
00039 {
00040 #endif
00041
00042
00043 #define OXS_KEY_USAGE_SIGN 0
00044
00045 #define OXS_KEY_USAGE_VERIFY 1
00046
00047 #define OXS_KEY_USAGE_ENCRYPT 2
00048
00049 #define OXS_KEY_USAGE_DECRYPT 3
00050
00051 #define OXS_KEY_USAGE_NONE 4
00052
00053 #define OXS_KEY_DEFAULT_SIZE 64
00054
00056 typedef struct oxs_key_t oxs_key_t;
00057
00065 unsigned char *AXIS2_CALL
00066 oxs_key_get_data(
00067 const oxs_key_t *key,
00068 const axutil_env_t *env);
00075 axis2_char_t *AXIS2_CALL
00076 oxs_key_get_name(
00077 const oxs_key_t *key,
00078 const axutil_env_t *env);
00085 int AXIS2_CALL
00086 oxs_key_get_size(
00087 const oxs_key_t *key,
00088 const axutil_env_t *env);
00095 int AXIS2_CALL
00096 oxs_key_get_usage(
00097 const oxs_key_t *key,
00098 const axutil_env_t *env);
00099
00100
00108 axis2_status_t AXIS2_CALL
00109 oxs_key_set_name(
00110 oxs_key_t *key,
00111 const axutil_env_t *env,
00112 axis2_char_t *name);
00113
00114
00122 axis2_status_t AXIS2_CALL
00123 oxs_key_set_usage(
00124 oxs_key_t *key,
00125 const axutil_env_t *env,
00126 int usage);
00127
00134 axis2_status_t AXIS2_CALL
00135 oxs_key_free(
00136 oxs_key_t *key,
00137 const axutil_env_t *env
00138 );
00139
00140 axis2_status_t AXIS2_CALL
00141 oxs_key_populate_with_buf(oxs_key_t *key,
00142 const axutil_env_t *env,
00143 oxs_buffer_t *buffer,
00144 axis2_char_t *name,
00145 int usage);
00146
00157 axis2_status_t AXIS2_CALL
00158 oxs_key_populate(
00159 oxs_key_t *key,
00160 const axutil_env_t *env,
00161 unsigned char *data,
00162 axis2_char_t *name,
00163 int size,
00164 int usage);
00165
00172 axis2_status_t AXIS2_CALL
00173 oxs_key_read_from_file(
00174 oxs_key_t *key,
00175 const axutil_env_t *env,
00176 axis2_char_t *file_name);
00177
00184 axis2_status_t AXIS2_CALL
00185 oxs_key_for_algo(oxs_key_t *key,
00186 const axutil_env_t *env,
00187 axis2_char_t *key_algo);
00188
00189
00190 oxs_buffer_t *AXIS2_CALL
00191 oxs_key_get_buffer(const oxs_key_t *key,
00192 const axutil_env_t *env);
00193
00194 oxs_key_t *AXIS2_CALL
00195 oxs_key_dup(oxs_key_t *key,
00196 const axutil_env_t *env);
00197
00198 AXIS2_EXTERN oxs_key_t *AXIS2_CALL
00199 oxs_key_create(const axutil_env_t *env);
00200
00201
00202 #ifdef __cplusplus
00203 }
00204 #endif
00205
00206 #endif