Grid Community Toolkit  6.2.1541705016
globus_gsi_proxy.h
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
22 #ifndef GLOBUS_GLOBUS_GSI_PROXY_H
23 #define GLOBUS_GLOBUS_GSI_PROXY_H
24 
25 #ifndef GLOBUS_GLOBAL_DOCUMENT_SET
26 
30 #endif
31 
63 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
64 #include "globus_gsi_credential.h"
65 #include "globus_error_generic.h"
66 #include "globus_error_openssl.h"
67 #include "openssl/evp.h"
68 #include "openssl/x509v3.h"
69 #include "proxypolicy.h"
70 #endif
71 
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
75 
111 #define GLOBUS_GSI_PROXY_MODULE (&globus_i_gsi_proxy_module)
112 
113 extern
114 globus_module_descriptor_t globus_i_gsi_proxy_module;
115 
116 #define _PCSL(s) globus_common_i18n_get_string(\
117  GLOBUS_GSI_PROXY_MODULE, \
118  s)
119 
135 typedef struct globus_l_gsi_proxy_handle_s *
137 
151 typedef struct
152 globus_l_gsi_proxy_handle_attrs_s * globus_gsi_proxy_handle_attrs_t;
153 
154 
170  globus_gsi_proxy_handle_t * handle,
171  globus_gsi_proxy_handle_attrs_t handle_attrs);
172 
176 
180  X509_REQ ** req);
181 
185  X509_REQ * req);
186 
190  EVP_PKEY ** proxy_key);
191 
195  const EVP_PKEY * proxy_key);
196 
201 
206 
207 
211  int * time_valid);
212 
216  int time_valid);
217 
221  const unsigned char * policy_data,
222  int policy_length,
223  int policy_NID);
224 
228  unsigned char ** policy_data,
229  int * policy_length,
230  int * policy_NID);
231 
235  X509_EXTENSION * extension);
236 
240  STACK_OF(X509_EXTENSION) * extensions);
241 
245  STACK_OF(X509_EXTENSION) ** extension);
246 
250  long pathlen);
251 
255  int * pathlen);
256 
260 
261 #ifdef GLOBUS_GSI_PROXY_CORE_COMPAT_0
262 #include "proxycertinfo.h"
263 
264 #define globus_gsi_proxy_handle_get_proxy_cert_info(h,p) \
265  globus_gsi_proxy_handle_get_proxy_cert_info_proxy_ssl(h,p)
266 #define globus_gsi_proxy_handle_set_proxy_cert_info(h,p) \
267  globus_gsi_proxy_handle_set_proxy_cert_info_proxy_ssl(h,p)
268 
270 globus_gsi_proxy_handle_get_proxy_cert_info_proxy_ssl(
272  PROXYCERTINFO ** pci);
273 
275 globus_gsi_proxy_handle_set_proxy_cert_info_proxy_ssl(
277  PROXYCERTINFO * pci);
278 #else
280 globus_gsi_proxy_handle_get_proxy_cert_info(
282  PROXY_CERT_INFO_EXTENSION ** pci);
283 
285 globus_gsi_proxy_handle_set_proxy_cert_info(
287  PROXY_CERT_INFO_EXTENSION * pci);
288 #endif
289 
293  char ** common_name);
294 
298  const char * common_name);
299 
303  globus_bool_t * is_limited);
304 
308  globus_bool_t is_limited);
309 
313  const EVP_MD ** algorithm);
314 
318  int * key_bits);
319 
323  int * init_prime);
324 
328  int * skew);
329 
333  void (**callback)(int, int, void *));
334 
349  globus_gsi_proxy_handle_attrs_t * handle_attrs);
350 
353  globus_gsi_proxy_handle_attrs_t handle_attrs);
354 
359 
373  BIO * output_bio);
374 
378  BIO * input_bio);
379 
383  globus_gsi_cred_handle_t issuer_credential,
384  BIO * output_bio);
385 
389  globus_gsi_cred_handle_t issuer_credential,
390  globus_gsi_cred_handle_t peer_credential,
391  globus_gsi_cred_handle_t * resigned_credential);
392 
396  globus_gsi_cred_handle_t * proxy_credential,
397  BIO * input_bio);
398 
403  globus_gsi_cred_handle_t * proxy_credential);
404 
407  globus_gsi_proxy_handle_attrs_t handle_attrs,
408  int bits);
409 
412  globus_gsi_proxy_handle_attrs_t handle_attrs,
413  int * bits);
414 
417  globus_gsi_proxy_handle_attrs_t handle_attrs,
418  int prime);
419 
422  globus_gsi_proxy_handle_attrs_t handle_attrs,
423  int * prime);
424 
427  globus_gsi_proxy_handle_attrs_t handle_attrs,
428  const EVP_MD * algorithm);
429 
432  globus_gsi_proxy_handle_attrs_t handle_attrs,
433  const EVP_MD ** algorithm);
434 
438  int skew);
439 
443  int * skew);
444 
448  void (**callback)(int, int, void *));
449 
453  void (*callback)(int, int, void *));
454 
455 #ifdef __cplusplus
456 }
457 #endif
458 
459 #endif /* GLOBUS_GLOBUS_GSI_PROXY_H */
globus_result_t globus_gsi_proxy_handle_get_common_name(globus_gsi_proxy_handle_t handle, char **common_name)
Get/Set Proxy Common Name.
Definition: globus_gsi_proxy_handle.c:1959
Globus GSI Credential Library.
globus_result_t globus_gsi_proxy_handle_set_private_key(globus_gsi_proxy_handle_t handle, const EVP_PKEY *proxy_key)
Set the private key in a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:491
globus_result_t globus_gsi_proxy_handle_get_policy(globus_gsi_proxy_handle_t handle, unsigned char **policy_data, int *policy_length, int *policy_NID)
Get Policy.
Definition: globus_gsi_proxy_handle.c:771
globus_result_t globus_gsi_proxy_handle_attrs_get_key_gen_callback(globus_gsi_proxy_handle_attrs_t handle, void(**callback)(int, int, void *))
Get Key Gen Callback.
Definition: globus_gsi_proxy_handle_attrs.c:528
globus_result_t globus_gsi_proxy_handle_add_extension(globus_gsi_proxy_handle_t handle, X509_EXTENSION *extension)
Add X.509 Extensions.
Definition: globus_gsi_proxy_handle.c:862
globus_result_t globus_gsi_proxy_sign_req(globus_gsi_proxy_handle_t handle, globus_gsi_cred_handle_t issuer_credential, BIO *output_bio)
Sign a proxy certificate request.
Definition: globus_gsi_proxy.c:1059
globus_result_t globus_gsi_proxy_handle_get_type(globus_gsi_proxy_handle_t handle, globus_gsi_cert_utils_cert_type_t *type)
Get Proxy Type.
Definition: globus_gsi_proxy_handle.c:553
globus_result_t globus_gsi_proxy_handle_attrs_get_keybits(globus_gsi_proxy_handle_attrs_t handle_attrs, int *bits)
Get Key Bits.
Definition: globus_gsi_proxy_handle_attrs.c:191
globus_result_t globus_gsi_proxy_create_req(globus_gsi_proxy_handle_t handle, BIO *output_bio)
Create a proxy credential request.
Definition: globus_gsi_proxy.c:213
globus_result_t globus_gsi_proxy_handle_get_pathlen(globus_gsi_proxy_handle_t handle, int *pathlen)
Get Path Length.
Definition: globus_gsi_proxy_handle.c:1142
globus_result_t globus_gsi_proxy_handle_attrs_set_clock_skew_allowable(globus_gsi_proxy_handle_attrs_t handle, int skew)
Set Clock Skew Allowable.
Definition: globus_gsi_proxy_handle_attrs.c:434
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
struct globus_l_gsi_cred_handle_s * globus_gsi_cred_handle_t
Definition: globus_gsi_credential.h:156
globus_result_t globus_gsi_proxy_handle_get_init_prime(globus_gsi_proxy_handle_t handle, int *init_prime)
Get Init Prime.
Definition: globus_gsi_proxy_handle.c:1789
globus_result_t globus_gsi_proxy_handle_attrs_get_clock_skew_allowable(globus_gsi_proxy_handle_attrs_t handle, int *skew)
Get Clock Skew Allowable.
Definition: globus_gsi_proxy_handle_attrs.c:478
globus_result_t globus_gsi_proxy_handle_destroy(globus_gsi_proxy_handle_t handle)
Destroy a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:205
globus_result_t globus_gsi_proxy_handle_clear_cert_info(globus_gsi_proxy_handle_t handle)
Clear Cert Info.
Definition: globus_gsi_proxy_handle.c:1289
globus_result_t globus_gsi_proxy_handle_set_is_limited(globus_gsi_proxy_handle_t handle, globus_bool_t is_limited)
Set/Check Proxy Is Limited.
Definition: globus_gsi_proxy_handle.c:2080
globus_result_t globus_gsi_proxy_create_signed(globus_gsi_proxy_handle_t handle, globus_gsi_cred_handle_t issuer, globus_gsi_cred_handle_t *proxy_credential)
Create Signed Proxy Certificate.
Definition: globus_gsi_proxy.c:1868
globus_result_t globus_gsi_proxy_handle_attrs_set_init_prime(globus_gsi_proxy_handle_attrs_t handle_attrs, int prime)
Set Initial Prime Number.
Definition: globus_gsi_proxy_handle_attrs.c:241
struct globus_l_gsi_proxy_handle_s * globus_gsi_proxy_handle_t
GSI Proxy Handle.
Definition: globus_gsi_proxy.h:135
globus_result_t globus_gsi_proxy_handle_get_req(globus_gsi_proxy_handle_t handle, X509_REQ **req)
Get the certificate request from a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:254
Definition: proxycertinfo.h:122
globus_result_t globus_gsi_proxy_resign_cert(globus_gsi_proxy_handle_t handle, globus_gsi_cred_handle_t issuer_credential, globus_gsi_cred_handle_t peer_credential, globus_gsi_cred_handle_t *resigned_credential)
Resign an existing certificate into a proxy.
Definition: globus_gsi_proxy.c:871
globus_result_t globus_gsi_proxy_handle_attrs_destroy(globus_gsi_proxy_handle_attrs_t handle_attrs)
Destroy attributes.
Definition: globus_gsi_proxy_handle_attrs.c:123
globus_result_t globus_gsi_proxy_is_limited(globus_gsi_proxy_handle_t handle, globus_bool_t *is_limited)
Definition: globus_gsi_proxy_handle.c:2160
globus_result_t globus_gsi_proxy_handle_get_keybits(globus_gsi_proxy_handle_t handle, int *key_bits)
Get Key Bits.
Definition: globus_gsi_proxy_handle.c:1734
globus_result_t globus_gsi_proxy_handle_attrs_get_init_prime(globus_gsi_proxy_handle_attrs_t handle_attrs, int *prime)
Get Initial Prime Number.
Definition: globus_gsi_proxy_handle_attrs.c:283
globus_result_t globus_gsi_proxy_handle_attrs_get_signing_algorithm(globus_gsi_proxy_handle_attrs_t handle_attrs, const EVP_MD **algorithm)
Get Signing Algorithm.
Definition: globus_gsi_proxy_handle_attrs.c:383
globus_result_t globus_gsi_proxy_handle_set_req(globus_gsi_proxy_handle_t handle, X509_REQ *req)
Set Request Set the certificate request in a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:313
Globus Generic Error.
globus_result_t globus_gsi_proxy_handle_init(globus_gsi_proxy_handle_t *handle, globus_gsi_proxy_handle_attrs_t handle_attrs)
Initialize a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:86
globus_result_t globus_gsi_proxy_handle_set_type(globus_gsi_proxy_handle_t handle, globus_gsi_cert_utils_cert_type_t type)
Get Proxy Type.
Definition: globus_gsi_proxy_handle.c:605
globus_result_t globus_gsi_proxy_handle_get_key_gen_callback(globus_gsi_proxy_handle_t handle, void(**callback)(int, int, void *))
Get Callback for Creating Keys.
Definition: globus_gsi_proxy_handle.c:1899
struct globus_l_gsi_proxy_handle_attrs_s * globus_gsi_proxy_handle_attrs_t
Handle Attributes.
Definition: globus_gsi_proxy.h:151
globus_result_t globus_gsi_proxy_handle_get_clock_skew_allowable(globus_gsi_proxy_handle_t handle, int *skew)
Get Clock Skew
Definition: globus_gsi_proxy_handle.c:1845
globus_result_t globus_gsi_proxy_handle_set_common_name(globus_gsi_proxy_handle_t handle, const char *common_name)
Definition: globus_gsi_proxy_handle.c:2022
uint32_t globus_result_t
Definition: globus_types.h:99
globus_result_t globus_gsi_proxy_handle_attrs_set_keybits(globus_gsi_proxy_handle_attrs_t handle_attrs, int bits)
Set Key Bits.
Definition: globus_gsi_proxy_handle_attrs.c:151
globus_result_t globus_gsi_proxy_handle_set_extensions(globus_gsi_proxy_handle_t handle, STACK_OF(X509_EXTENSION) *extensions)
Set X.509 Extensions.
Definition: globus_gsi_proxy_handle.c:933
globus_result_t globus_gsi_proxy_handle_attrs_copy(globus_gsi_proxy_handle_attrs_t a, globus_gsi_proxy_handle_attrs_t *b)
Copy Attributes.
Definition: globus_gsi_proxy_handle_attrs.c:616
globus_result_t globus_gsi_proxy_handle_set_time_valid(globus_gsi_proxy_handle_t handle, int time_valid)
Set Time Valid.
Definition: globus_gsi_proxy_handle.c:1248
globus_result_t globus_gsi_proxy_handle_set_pathlen(globus_gsi_proxy_handle_t handle, long pathlen)
Set Path Length.
Definition: globus_gsi_proxy_handle.c:1081
Proxy Certificate Info.
enum globus_gsi_cert_utils_cert_type_e globus_gsi_cert_utils_cert_type_t
Globus Error API.
globus_result_t globus_gsi_proxy_inquire_req(globus_gsi_proxy_handle_t handle, BIO *input_bio)
Inquire a proxy credential request.
Definition: globus_gsi_proxy.c:665
globus_result_t globus_gsi_proxy_assemble_cred(globus_gsi_proxy_handle_t handle, globus_gsi_cred_handle_t *proxy_credential, BIO *input_bio)
Assemble a proxy credential.
Definition: globus_gsi_proxy.c:2116
globus_result_t globus_gsi_proxy_handle_get_time_valid(globus_gsi_proxy_handle_t handle, int *time_valid)
Get Time Valid.
Definition: globus_gsi_proxy_handle.c:1198
globus_result_t globus_gsi_proxy_handle_attrs_init(globus_gsi_proxy_handle_attrs_t *handle_attrs)
Initialize Attributes.
Definition: globus_gsi_proxy_handle_attrs.c:65
globus_result_t globus_gsi_proxy_handle_get_extensions(globus_gsi_proxy_handle_t handle, STACK_OF(X509_EXTENSION) **extension)
Get X.509 Extensions.
Definition: globus_gsi_proxy_handle.c:1009
globus_result_t globus_gsi_proxy_handle_get_private_key(globus_gsi_proxy_handle_t handle, EVP_PKEY **proxy_key)
Get the private key from a GSI Proxy handle.
Definition: globus_gsi_proxy_handle.c:375
globus_result_t globus_gsi_proxy_handle_attrs_set_key_gen_callback(globus_gsi_proxy_handle_attrs_t handle, void(*callback)(int, int, void *))
Set Key Gen Callback.
Definition: globus_gsi_proxy_handle_attrs.c:578
globus_result_t globus_gsi_proxy_handle_set_policy(globus_gsi_proxy_handle_t handle, const unsigned char *policy_data, int policy_length, int policy_NID)
Set Policy.
Definition: globus_gsi_proxy_handle.c:679
Proxy Policy.
globus_result_t globus_gsi_proxy_handle_attrs_set_signing_algorithm(globus_gsi_proxy_handle_attrs_t handle_attrs, const EVP_MD *algorithm)
Set Signing Algorithm.
Definition: globus_gsi_proxy_handle_attrs.c:336
Module Descriptor.
Definition: globus_module.h:69
globus_result_t globus_gsi_proxy_handle_get_signing_algorithm(globus_gsi_proxy_handle_t handle, const EVP_MD **algorithm)
Get Signing Algorithm.
Definition: globus_gsi_proxy_handle.c:1678