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_algorithm(const oxs_asym_ctx_t *ctx,
00088                                const axutil_env_t *env);
00089 
00096     AXIS2_EXTERN axis2_char_t* AXIS2_CALL
00097     oxs_asym_ctx_get_st_ref_pattern(const oxs_asym_ctx_t *ctx,
00098                                     const axutil_env_t *env);
00099 
00106     AXIS2_EXTERN oxs_asym_ctx_operation_t AXIS2_CALL
00107     oxs_asym_ctx_get_operation(const oxs_asym_ctx_t *ctx,
00108                                const axutil_env_t *env);
00109 
00116     AXIS2_EXTERN openssl_pkey_t* AXIS2_CALL
00117     oxs_asym_ctx_get_private_key(const oxs_asym_ctx_t *ctx,
00118                                  const axutil_env_t *env);
00119 
00126     AXIS2_EXTERN oxs_x509_cert_t* AXIS2_CALL
00127     oxs_asym_ctx_get_certificate(const oxs_asym_ctx_t *ctx,
00128                                  const axutil_env_t *env);
00129 
00137     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00138     oxs_asym_ctx_set_algorithm(oxs_asym_ctx_t *ctx,
00139                                const axutil_env_t *env,
00140                                axis2_char_t *algorithm);
00148     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00149     oxs_asym_ctx_set_st_ref_pattern(oxs_asym_ctx_t *ctx,
00150                                     const axutil_env_t *env,
00151                                     axis2_char_t *st_ref_pattern);
00159     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00160     oxs_asym_ctx_set_operation(oxs_asym_ctx_t *ctx,
00161                                const axutil_env_t *env,
00162                                oxs_asym_ctx_operation_t operation);
00170     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00171     oxs_asym_ctx_set_certificate(oxs_asym_ctx_t *ctx,
00172                                  const axutil_env_t *env,
00173                                  oxs_x509_cert_t *certificate);
00181     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00182     oxs_asym_ctx_set_private_key(oxs_asym_ctx_t *asym_ctx,
00183                                  const axutil_env_t *env,
00184                                  openssl_pkey_t *private_key);
00186 #ifdef __cplusplus
00187 }
00188 #endif
00189 
00190 #endif                          /* OXS_ASYM_CTX_H */

Generated on Wed May 13 10:52:52 2009 for Rampart/C by  doxygen 1.5.5