# oxs_sign_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_SIGN_CTX_H
    00019 #define OXS_SIGN_CTX_H
    00020
    00021
    00032 #include <axis2_defines.h>
    00033 #include <axutil_env.h>
    00034 #include <axiom_node.h>
    00035 #include <oxs_x509_cert.h>
    00036 #include <oxs_key.h>
    00037 #include <openssl_pkey.h>
    00038
    00039 #ifdef __cplusplus
    00040 extern "C"
    00041 {
    00042 #endif
    00043
    00044     /*The type of operation*/
    00045     typedef enum  {
    00046         OXS_SIGN_OPERATION_NONE = 0,
    00047         OXS_SIGN_OPERATION_SIGN,
    00048         OXS_SIGN_OPERATION_VERIFY
    00049     } oxs_sign_operation_t;
    00050
    00051
    00052     typedef struct oxs_sign_ctx_t oxs_sign_ctx_t;
    00053
    00059     AXIS2_EXTERN oxs_sign_ctx_t *AXIS2_CALL
    00060     oxs_sign_ctx_create(const axutil_env_t *env);
    00061
    00069     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00070     oxs_sign_ctx_free(oxs_sign_ctx_t *ctx,
    00071                       const axutil_env_t *env);
    00072
    00073
    00074     /**********************Getter functions******************************************/
    00081     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    00082     oxs_sign_ctx_get_sign_mtd_algo(
    00083         const oxs_sign_ctx_t *sign_ctx,
    00084         const axutil_env_t *env);
    00085
    00092     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    00093     oxs_sign_ctx_get_c14n_mtd(
    00094         const oxs_sign_ctx_t *sign_ctx,
    00095         const axutil_env_t *env);
    00096
    00103     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    00104     oxs_sign_ctx_get_sig_val(
    00105         const oxs_sign_ctx_t *sign_ctx,
    00106         const axutil_env_t *env);
    00107
    00114     AXIS2_EXTERN axutil_array_list_t *AXIS2_CALL
    00115     oxs_sign_ctx_get_sign_parts(
    00116         const oxs_sign_ctx_t *sign_ctx,
    00117         const axutil_env_t *env);
    00118
    00125     AXIS2_EXTERN oxs_x509_cert_t *AXIS2_CALL
    00126     oxs_sign_ctx_get_certificate(
    00127         const oxs_sign_ctx_t *sign_ctx,
    00128         const axutil_env_t *env);
    00136     AXIS2_EXTERN openssl_pkey_t *AXIS2_CALL
    00137     oxs_sign_ctx_get_private_key(
    00138         const oxs_sign_ctx_t *sign_ctx,
    00139         const axutil_env_t *env);
    00140
    00147     AXIS2_EXTERN openssl_pkey_t *AXIS2_CALL
    00148     oxs_sign_ctx_get_public_key(
    00149         const oxs_sign_ctx_t *sign_ctx,
    00150         const axutil_env_t *env);
    00151
    00158     AXIS2_EXTERN oxs_key_t *AXIS2_CALL
    00159     oxs_sign_ctx_get_secret(
    00160     const oxs_sign_ctx_t *sign_ctx,
    00161     const axutil_env_t *env);
    00162
    00169     AXIS2_EXTERN oxs_sign_operation_t AXIS2_CALL
    00170     oxs_sign_ctx_get_operation(
    00171         const oxs_sign_ctx_t *sign_ctx,
    00172         const axutil_env_t *env);
    00173
    00174     /**********************Setter functions******************************************/
    00182     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00183     oxs_sign_ctx_set_sign_mtd_algo(
    00184         oxs_sign_ctx_t *sign_ctx,
    00185         const axutil_env_t *env,
    00186         axis2_char_t *sign_mtd_algo);
    00187
    00195     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00196     oxs_sign_ctx_set_c14n_mtd(
    00197         oxs_sign_ctx_t *sign_ctx,
    00198         const axutil_env_t *env,
    00199         axis2_char_t *c14n_mtd);
    00200
    00208     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00209     oxs_sign_ctx_set_sig_val(
    00210         oxs_sign_ctx_t *sign_ctx,
    00211         const axutil_env_t *env,
    00212         axis2_char_t *sig_val);
    00213
    00221     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00222     oxs_sign_ctx_set_sign_parts(
    00223         oxs_sign_ctx_t *sign_ctx,
    00224         const axutil_env_t *env,
    00225         axutil_array_list_t *sign_parts);
    00226
    00234     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00235     oxs_sign_ctx_set_certificate(
    00236         oxs_sign_ctx_t *sign_ctx,
    00237         const axutil_env_t *env,
    00238         oxs_x509_cert_t *certificate);
    00239
    00247     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00248     oxs_sign_ctx_set_private_key(
    00249         oxs_sign_ctx_t *sign_ctx,
    00250         const axutil_env_t *env,
    00251         openssl_pkey_t *prv_key);
    00252
    00260     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00261     oxs_sign_ctx_set_public_key(
    00262         oxs_sign_ctx_t *sign_ctx,
    00263         const axutil_env_t *env,
    00264         openssl_pkey_t *pub_key);
    00265
    00273     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00274     oxs_sign_ctx_set_secret(
    00275         oxs_sign_ctx_t *sign_ctx,
    00276         const axutil_env_t *env,
    00277         oxs_key_t *secret);
    00278
    00286     AXIS2_EXTERN axis2_status_t AXIS2_CALL
    00287     oxs_sign_ctx_set_operation(
    00288         oxs_sign_ctx_t *sign_ctx,
    00289         const axutil_env_t *env,
    00290         oxs_sign_operation_t operation);
    00292 #ifdef __cplusplus
    00293 }
    00294 #endif
    00295
    00296 #endif                          /* OXS_SIGN_CTX_H */