globus_gsi_cert_utils.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2006 University of Chicago
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00024 #ifndef GLOBUS_GSI_CERT_UTILS_H
00025 #define GLOBUS_GSI_CERT_UTILS_H
00026 
00027 
00028 #include "globus_common.h"
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
00035 
00039 #endif
00040 
00087 #define GLOBUS_GSI_CERT_UTILS_MODULE    (&globus_i_gsi_cert_utils_module)
00088 
00089 extern 
00090 globus_module_descriptor_t              globus_i_gsi_cert_utils_module;
00091 
00092 #define _CUSL(s) globus_common_i18n_get_string(GLOBUS_GSI_CERT_UTILS_MODULE,\
00093                 s)
00094 
00095 #ifndef DOXYGEN
00096 
00097 #include "openssl/x509.h"
00098 #include "openssl/asn1.h"
00099 #include "globus_error_openssl.h"
00100 #include "globus_gsi_cert_utils_constants.h"
00101 
00102 #define GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type) \
00103         ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0)
00104 
00105 #define GLOBUS_GSI_CERT_UTILS_IS_RFC_PROXY(cert_type) \
00106         (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
00107          ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_RFC) != 0))
00108 
00109 #define GLOBUS_GSI_CERT_UTILS_IS_GSI_3_PROXY(cert_type) \
00110         (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
00111          ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_GSI_3) != 0))
00112 
00113 #define GLOBUS_GSI_CERT_UTILS_IS_GSI_2_PROXY(cert_type) \
00114         (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
00115          ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_GSI_2) != 0))
00116 
00117 #define GLOBUS_GSI_CERT_UTILS_IS_INDEPENDENT_PROXY(cert_type) \
00118         ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_INDEPENDENT_PROXY) != 0)
00119 
00120 #define GLOBUS_GSI_CERT_UTILS_IS_RESTRICTED_PROXY(cert_type) \
00121         ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_RESTRICTED_PROXY) != 0)
00122 
00123 #define GLOBUS_GSI_CERT_UTILS_IS_LIMITED_PROXY(cert_type) \
00124         ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_LIMITED_PROXY) != 0)
00125 
00126 #define GLOBUS_GSI_CERT_UTILS_IS_IMPERSONATION_PROXY(cert_type) \
00127         ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_IMPERSONATION_PROXY) != 0)
00128 
00129 globus_result_t
00130 globus_gsi_cert_utils_make_time(
00131     const ASN1_UTCTIME *                ctm,
00132     time_t *                            newtime);
00133 
00134 globus_result_t
00135 globus_gsi_cert_utils_get_base_name(
00136     X509_NAME *                         subject,
00137     STACK_OF(X509) *                    cert_chain);
00138 
00139 globus_result_t
00140 globus_gsi_cert_utils_get_eec(
00141     STACK_OF(X509) *                    cert_chain,
00142     X509 **                             eec);
00143 
00144 globus_result_t
00145 globus_gsi_cert_utils_get_identity_cert(
00146     STACK_OF(X509) *                    cert_chain,
00147     X509 **                             eec);
00148 
00149 globus_result_t
00150 globus_gsi_cert_utils_get_cert_type(
00151     X509 *                              cert,
00152     globus_gsi_cert_utils_cert_type_t * type);
00153 
00154 globus_result_t
00155 globus_gsi_cert_utils_get_x509_name(
00156     const char *                        subject_string,
00157     int                                 length,
00158     X509_NAME *                         x509_name);
00159 
00160 int
00161 globus_i_gsi_cert_utils_dn_cmp(
00162     const char *                        dn1,
00163     const char *                        dn2);
00164 
00165 /* For backwards compatibility */
00166 
00167 #define globus_gsi_cert_utils_create_string \
00168     globus_common_create_string
00169 
00170 #define globus_gsi_cert_utils_create_nstring \
00171     globus_common_create_nstring
00172 
00173 #define globus_gsi_cert_utils_v_create_string \
00174     globus_common_v_create_string
00175 
00176 #define globus_gsi_cert_utils_v_create_nstring \
00177     globus_common_v_create_nstring
00178 
00179 #endif /* DOXYGEN */
00180 
00181 #ifdef __cplusplus
00182 }
00183 #endif
00184 
00185 #endif /* GLOBUS_GSI_CERT_UTILS_H */

Generated on 11 Jan 2017 for globus_gsi_cert_utils by  doxygen 1.4.7