oxs_asym_ctx.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_ASYM_CTX_H
00019 #define OXS_ASYM_CTX_H
00020 
00021 
00027 #include <axis2_defines.h>
00028 #include <axutil_env.h>
00029 #include <axiom_node.h>
00030 #include <oxs_x509_cert.h>
00031 #include <openssl_pkey.h>
00032 
00033 #ifdef __cplusplus
00034 extern "C"
00035 {
00036 #endif
00037 
00043     typedef enum  {
00044         OXS_ASYM_CTX_FORMAT_UNKNOWN=0,
00045         OXS_ASYM_CTX_FORMAT_PEM,
00046         OXS_ASYM_CTX_FORMAT_PKCS12
00047     }oxs_asym_ctx_format_t;
00048 
00049     typedef enum  {
00050         OXS_ASYM_CTX_OPERATION_PUB_ENCRYPT=0,
00051         OXS_ASYM_CTX_OPERATION_PRV_DECRYPT,
00052         OXS_ASYM_CTX_OPERATION_PUB_DECRYPT,
00053         OXS_ASYM_CTX_OPERATION_PRV_ENCRYPT
00054     }oxs_asym_ctx_operation_t;
00055 
00056     typedef struct oxs_asym_ctx_t oxs_asym_ctx_t;
00057 
00058     /*Create function*/
00059     AXIS2_EXTERN oxs_asym_ctx_t *AXIS2_CALL
00060     oxs_asym_ctx_create(const axutil_env_t *env);
00061 
00062     /*Free*/
00063     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00064     oxs_asym_ctx_free(oxs_asym_ctx_t *ctx,
00065                       const axutil_env_t *env);
00066 
00067 
00068     /**********************Getter functions******************************************/
00069 
00076     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00077     oxs_asym_ctx_free(oxs_asym_ctx_t *ctx,
00078                       const axutil_env_t *env);
00079 
00086     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00087     oxs_asym_ctx_get_file_name(const oxs_asym_ctx_t *ctx,
00088                                const axutil_env_t *env);
00089 
00095     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00096     oxs_asym_ctx_get_pem_buf(const oxs_asym_ctx_t *ctx,
00097                              const axutil_env_t *env);
00105     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00106     oxs_asym_ctx_get_password(const oxs_asym_ctx_t *ctx,
00107                               const axutil_env_t *env);
00108 
00115     AXIS2_EXTERN oxs_asym_ctx_format_t AXIS2_CALL
00116     oxs_asym_ctx_get_format(const oxs_asym_ctx_t *ctx,
00117                             const axutil_env_t *env);
00118 
00125     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00126     oxs_asym_ctx_get_algorithm(const oxs_asym_ctx_t *ctx,
00127                                const axutil_env_t *env);
00128 
00135     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00136     oxs_asym_ctx_get_st_ref_pattern(const oxs_asym_ctx_t *ctx,
00137                                     const axutil_env_t *env);
00138 
00145     AXIS2_EXTERN oxs_asym_ctx_operation_t AXIS2_CALL
00146     oxs_asym_ctx_get_operation(const oxs_asym_ctx_t *ctx,
00147                                const axutil_env_t *env);
00148 
00155     AXIS2_EXTERN openssl_pkey_t* AXIS2_CALL
00156     oxs_asym_ctx_get_private_key(const oxs_asym_ctx_t *ctx,
00157                                  const axutil_env_t *env);
00158 
00165     AXIS2_EXTERN oxs_x509_cert_t* AXIS2_CALL
00166     oxs_asym_ctx_get_certificate(const oxs_asym_ctx_t *ctx,
00167                                  const axutil_env_t *env);
00168 
00175     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00176     oxs_asym_ctx_set_file_name(oxs_asym_ctx_t *ctx,
00177                                const axutil_env_t *env,
00178                                axis2_char_t *file_name);
00185     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00186     oxs_asym_ctx_set_pem_buf(oxs_asym_ctx_t *ctx,
00187                              const axutil_env_t *env,
00188                              axis2_char_t *pem_buf);
00197     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00198     oxs_asym_ctx_set_password(oxs_asym_ctx_t *ctx,
00199                               const axutil_env_t *env,
00200                               axis2_char_t *password);
00208     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00209     oxs_asym_ctx_set_format(oxs_asym_ctx_t *ctx,
00210                             const axutil_env_t *env,
00211                             oxs_asym_ctx_format_t format);
00219     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00220     oxs_asym_ctx_set_algorithm(oxs_asym_ctx_t *ctx,
00221                                const axutil_env_t *env,
00222                                axis2_char_t *algorithm);
00230     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00231     oxs_asym_ctx_set_st_ref_pattern(oxs_asym_ctx_t *ctx,
00232                                     const axutil_env_t *env,
00233                                     axis2_char_t *st_ref_pattern);
00241     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00242     oxs_asym_ctx_set_operation(oxs_asym_ctx_t *ctx,
00243                                const axutil_env_t *env,
00244                                oxs_asym_ctx_operation_t operation);
00252     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00253     oxs_asym_ctx_set_certificate(oxs_asym_ctx_t *ctx,
00254                                  const axutil_env_t *env,
00255                                  oxs_x509_cert_t *certificate);
00263     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00264     oxs_asym_ctx_set_private_key(oxs_asym_ctx_t *asym_ctx,
00265                                  const axutil_env_t *env,
00266                                  openssl_pkey_t *private_key);
00268 #ifdef __cplusplus
00269 }
00270 #endif
00271 
00272 #endif                          /* OXS_ASYM_CTX_H */

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