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 RAMPART_SCT_PROVIDER_H 00019 #define RAMPART_SCT_PROVIDER_H 00020 00032 #include <axis2_defines.h> 00033 #include <axutil_env.h> 00034 #include <rampart_context.h> 00035 00036 #ifdef __cplusplus 00037 extern "C" 00038 { 00039 #endif 00040 00041 typedef struct rampart_sct_provider_ops rampart_sct_provider_ops_t; 00042 typedef struct rampart_sct_provider rampart_sct_provider_t; 00043 00044 struct rampart_sct_provider_ops 00045 { 00046 /* This function will be called to get previously stored sct. If secure conversation token 00047 * is referred by this method, then sct_id will be not null. However, if security context 00048 * token (pre-agreed and established offline) is refered then sct_id might be NULL. 00049 * is_encryption is passed, so that if pre-agreed sct is different for encryption and 00050 * signature, then it could be accessed. sct_id_type can be RAMPART_SCT_ID_TYPE_LOCAL 00051 * or RAMPART_SCT_ID_TYPE_GLOBAL. user_param will be whatever stored using 00052 * rampart_context_set_security_context_token_user_params. 00053 */ 00054 obtain_security_context_token_fn obtain_security_context_token; 00055 00056 /* This function will be used to store sct. Global id, local id will be given so function 00057 * writer can store them in anyway. Get or Delete method will use any of the Global id or 00058 * local id, so Store function writer should be ready for that. 00059 */ 00060 store_security_context_token_fn store_security_context_token; 00061 00062 /* This function will be called to delete previously stored sct. sct_id_type can be 00063 * RAMPART_SCT_ID_TYPE_LOCAL or RAMPART_SCT_ID_TYPE_GLOBAL 00064 */ 00065 delete_security_context_token_fn delete_security_context_token; 00066 00067 /* Validates whether security context token is valid or not. Normally, we can directly send 00068 * true as response. But if syntax of security context token is altered/added by using 00069 * extensible mechanism (e.g having sessions, etc.) then user can implement this method. 00070 * Axiom representation of the sct will be given as the parameter, because if sct is 00071 * extended, we don't know the syntax. Method writer can implement whatever needed. 00072 */ 00073 validate_security_context_token_fn validate_security_context_token; 00074 00075 /* This function will be called to get the user paramters. It will be called only when 00076 * loading sct_provider module. If user_params are not needed, this method can return NULL 00077 */ 00078 void* (AXIS2_CALL* 00079 get_user_params)( 00080 const axutil_env_t *env); 00081 00082 /* This function will be called to free security context token provider module */ 00083 axis2_status_t (AXIS2_CALL* 00084 free)( 00085 rampart_sct_provider_t *sct_provider, 00086 const axutil_env_t* env); 00087 }; 00088 00089 struct rampart_sct_provider 00090 { 00091 rampart_sct_provider_ops_t *ops; 00092 axutil_param_t *param; 00093 }; 00094 00095 /*************************** Function macros **********************************/ 00096 #define RAMPART_SCT_PROVIDER_FREE(sct_provider, env) \ 00097 ((sct_provider)->ops->free(sct_provider, env)) 00098 00100 #ifdef __cplusplus 00101 } 00102 #endif 00103 00104 #endif /* RAMPART_SCT_PROVIDER_H */ 00105 00106