oxs_key.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
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     /*Key is for signing*/
00043 #define OXS_KEY_USAGE_SIGN          0
00044     /*Key is for verifying signature*/
00045 #define OXS_KEY_USAGE_VERIFY        1
00046     /*Key is for encrypting */
00047 #define OXS_KEY_USAGE_ENCRYPT       2
00048     /*Key is for decrypting*/
00049 #define OXS_KEY_USAGE_DECRYPT       3
00050     /*Key usage is not specified yet*/
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                          /* OXS_KEY_H */

Generated on Thu Oct 4 17:37:07 2007 for Rampart/C by  doxygen 1.4.7