globus_gsi_cert_utils  9.19
 All Files Functions Typedefs Enumerations Enumerator Groups Pages
globus_gsi_cert_utils.h
Go to the documentation of this file.
1 
9 #ifndef GLOBUS_GSI_CERT_UTILS_H
10 #define GLOBUS_GSI_CERT_UTILS_H
11 
12 
13 #include "globus_common.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
20 
24 #endif
25 
72 #define GLOBUS_GSI_CERT_UTILS_MODULE (&globus_i_gsi_cert_utils_module)
73 
74 extern
75 globus_module_descriptor_t globus_i_gsi_cert_utils_module;
76 
77 #define _CUSL(s) globus_common_i18n_get_string(GLOBUS_GSI_CERT_UTILS_MODULE,\
78  s)
79 
80 #ifndef DOXYGEN
81 
82 #include "openssl/x509.h"
83 #include "openssl/asn1.h"
84 #include "globus_error_openssl.h"
85 #include "globus_gsi_cert_utils_constants.h"
86 
87 #define GLOBUS_GSI_CERT_UTILS_IS_PROXY(cert_type) \
88  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0)
89 
90 #define GLOBUS_GSI_CERT_UTILS_IS_RFC_PROXY(cert_type) \
91  (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
92  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_RFC) != 0))
93 
94 #define GLOBUS_GSI_CERT_UTILS_IS_GSI_3_PROXY(cert_type) \
95  (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
96  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_GSI_3) != 0))
97 
98 #define GLOBUS_GSI_CERT_UTILS_IS_GSI_2_PROXY(cert_type) \
99  (((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_PROXY_MASK) != 0) && \
100  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_GSI_2) != 0))
101 
102 #define GLOBUS_GSI_CERT_UTILS_IS_INDEPENDENT_PROXY(cert_type) \
103  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_INDEPENDENT_PROXY) != 0)
104 
105 #define GLOBUS_GSI_CERT_UTILS_IS_RESTRICTED_PROXY(cert_type) \
106  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_RESTRICTED_PROXY) != 0)
107 
108 #define GLOBUS_GSI_CERT_UTILS_IS_LIMITED_PROXY(cert_type) \
109  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_LIMITED_PROXY) != 0)
110 
111 #define GLOBUS_GSI_CERT_UTILS_IS_IMPERSONATION_PROXY(cert_type) \
112  ((cert_type & GLOBUS_GSI_CERT_UTILS_TYPE_IMPERSONATION_PROXY) != 0)
113 
114 globus_result_t
116  const ASN1_UTCTIME * ctm,
117  time_t * newtime);
118 
119 globus_result_t
121  X509_NAME * subject,
122  STACK_OF(X509) * cert_chain);
123 
124 globus_result_t
126  STACK_OF(X509) * cert_chain,
127  X509 ** eec);
128 
129 globus_result_t
131  STACK_OF(X509) * cert_chain,
132  X509 ** eec);
133 
134 globus_result_t
136  X509 * cert,
138 
139 globus_result_t
141  const char * subject_string,
142  int length,
143  X509_NAME * x509_name);
144 
145 int
146 globus_i_gsi_cert_utils_dn_cmp(
147  const char * dn1,
148  const char * dn2);
149 
150 /* For backwards compatibility */
151 
152 #define globus_gsi_cert_utils_create_string \
153  globus_common_create_string
154 
155 #define globus_gsi_cert_utils_create_nstring \
156  globus_common_create_nstring
157 
158 #define globus_gsi_cert_utils_v_create_string \
159  globus_common_v_create_string
160 
161 #define globus_gsi_cert_utils_v_create_nstring \
162  globus_common_v_create_nstring
163 
164 #endif /* DOXYGEN */
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* GLOBUS_GSI_CERT_UTILS_H */
globus_result_t globus_gsi_cert_utils_get_x509_name(const char *subject_string, int length, X509_NAME *x509_name)
Get the certificate name.
Definition: globus_gsi_cert_utils.c:594
globus_result_t globus_gsi_cert_utils_get_eec(STACK_OF(X509)*cert_chain, X509 **eec)
Get the end-entity certificate from a certificate chain.
Definition: globus_gsi_cert_utils.c:850
globus_result_t globus_gsi_cert_utils_get_base_name(X509_NAME *subject, STACK_OF(X509)*cert_chain)
Get the base certificate name from a certificate chain.
Definition: globus_gsi_cert_utils.c:780
globus_result_t globus_gsi_cert_utils_get_cert_type(X509 *cert, globus_gsi_cert_utils_cert_type_t *type)
Get the X509 certificate type.
Definition: globus_gsi_cert_utils.c:283
globus_result_t globus_gsi_cert_utils_make_time(const ASN1_UTCTIME *ctm, time_t *newtime)
Convert ASN1_UTCTIME to time_t.
Definition: globus_gsi_cert_utils.c:173
globus_result_t globus_gsi_cert_utils_get_identity_cert(STACK_OF(X509)*cert_chain, X509 **identity_cert)
Get the identity certificate from a certificate chain.
Definition: globus_gsi_cert_utils.c:904
enum globus_gsi_cert_utils_cert_type_e globus_gsi_cert_utils_cert_type_t