Loading...
Searching...
No Matches
globus_gsi_credential.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_INCLUDE_GLOBUS_GSI_CREDENTIAL_H
#define GLOBUS_INCLUDE_GLOBUS_GSI_CREDENTIAL_H
#include "globus_common.h"
#include "globus_error_openssl.h"
#include "globus_gsi_cred_constants.h"
#include "globus_gsi_callback.h"
#include "globus_gsi_cert_utils.h"
#include "globus_gsi_cred_constants.h"
#include "openssl/x509.h"
#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "globus_error_generic.h"
#include "globus_error_openssl.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLOBUS_GLOBAL_DOCUMENT_SET
#endif
#define GLOBUS_GSI_CREDENTIAL_MODULE (&globus_i_gsi_credential_module)
extern
globus_module_descriptor_t globus_i_gsi_credential_module;
#define _GCRSL(s) globus_common_i18n_get_string( \
GLOBUS_GSI_CREDENTIAL_MODULE, \
s)
typedef struct globus_l_gsi_cred_handle_s *
globus_gsi_cred_handle_t;
typedef struct globus_l_gsi_cred_handle_attrs_s *
globus_gsi_cred_handle_attrs_t;
globus_result_t globus_gsi_cred_handle_init(
globus_gsi_cred_handle_t * handle,
globus_gsi_cred_handle_attrs_t handle_attrs);
globus_result_t globus_gsi_cred_handle_destroy(
globus_gsi_cred_handle_t handle);
globus_result_t globus_gsi_cred_handle_copy(
globus_gsi_cred_handle_t source,
globus_gsi_cred_handle_t * dest);
globus_result_t globus_gsi_cred_handle_attrs_init(
globus_gsi_cred_handle_attrs_t * handle_attrs);
globus_result_t globus_gsi_cred_handle_attrs_destroy(
globus_gsi_cred_handle_attrs_t handle_attrs);
globus_result_t globus_gsi_cred_handle_attrs_copy(
globus_gsi_cred_handle_attrs_t source,
globus_gsi_cred_handle_attrs_t * dest);
globus_result_t globus_gsi_cred_read(
globus_gsi_cred_handle_t handle,
X509_NAME * desired_subject);
globus_result_t globus_gsi_cred_read_proxy(
globus_gsi_cred_handle_t handle,
const char * proxy_filename);
globus_result_t globus_gsi_cred_read_proxy_bio(
globus_gsi_cred_handle_t handle,
BIO * bio);
globus_result_t globus_gsi_cred_read_key(
globus_gsi_cred_handle_t handle,
const char * key_filename,
pem_password_cb * pw_cb);
globus_result_t globus_gsi_cred_read_cert(
globus_gsi_cred_handle_t handle,
const char * cert_filename);
globus_result_t globus_gsi_cred_read_cert_bio(
globus_gsi_cred_handle_t handle,
BIO * bio);
globus_result_t globus_gsi_cred_read_cert_buffer(
const char * pem_buf,
globus_gsi_cred_handle_t * out_handle,
X509 ** out_cert,
STACK_OF(X509) ** out_cert_chain,
char ** out_subject);
globus_result_t globus_gsi_cred_read_pkcs12(
globus_gsi_cred_handle_t handle,
const char * pkcs12_filename);
globus_result_t globus_gsi_cred_write(
globus_gsi_cred_handle_t handle,
BIO * bio);
globus_result_t globus_gsi_cred_write_proxy(
globus_gsi_cred_handle_t handle,
const char * proxy_filename);
globus_result_t
globus_gsi_cred_verify_cert_chain(
globus_gsi_cred_handle_t cred_handle,
globus_gsi_callback_data_t callback_data);
globus_result_t
globus_gsi_cred_verify_cert_chain_when(
globus_gsi_cred_handle_t cred_handle,
globus_gsi_callback_data_t callback_data,
time_t check_time);
globus_result_t globus_gsi_cred_verify(
globus_gsi_cred_handle_t handle);
globus_result_t globus_gsi_cred_get_X509_subject_name(
globus_gsi_cred_handle_t handle,
X509_NAME ** subject_name);
globus_result_t globus_gsi_cred_get_subject_name(
globus_gsi_cred_handle_t handle,
char ** subject_name);
globus_result_t globus_gsi_cred_get_policies(
globus_gsi_cred_handle_t handle,
STACK_OF(OPENSSL_STRING) ** policies);
globus_result_t globus_gsi_cred_get_policy_languages(
globus_gsi_cred_handle_t handle,
STACK_OF(ASN1_OBJECT) ** languages);
globus_result_t globus_gsi_cred_get_path_lengths(
globus_gsi_cred_handle_t handle,
STACK_OF(ASN1_INTEGER) * integer);
globus_result_t globus_gsi_cred_get_X509_issuer_name(
globus_gsi_cred_handle_t handle,
X509_NAME ** issuer_name);
globus_result_t globus_gsi_cred_get_issuer_name(
globus_gsi_cred_handle_t handle,
char ** issuer_name);
globus_result_t globus_gsi_cred_get_X509_identity_name(
globus_gsi_cred_handle_t handle,
X509_NAME ** identity_name);
globus_result_t globus_gsi_cred_get_identity_name(
globus_gsi_cred_handle_t handle,
char ** identity_name);
globus_result_t globus_gsi_cred_set_cert(
globus_gsi_cred_handle_t handle,
X509 * cert);
globus_result_t globus_gsi_cred_set_key(
globus_gsi_cred_handle_t handle,
EVP_PKEY * key);
globus_result_t globus_gsi_cred_set_cert_chain(
globus_gsi_cred_handle_t handle,
STACK_OF(X509) * cert_chain);
globus_result_t globus_gsi_cred_get_cert(
globus_gsi_cred_handle_t handle,
X509 ** cert);
globus_result_t globus_gsi_cred_get_key(
globus_gsi_cred_handle_t handle,
EVP_PKEY ** key);
globus_result_t globus_gsi_cred_get_cert_chain(
globus_gsi_cred_handle_t handle,
STACK_OF(X509) ** cert_chain);
globus_result_t globus_gsi_cred_get_handle_attrs(
globus_gsi_cred_handle_t handle,
globus_gsi_cred_handle_attrs_t * handle_attrs);
globus_result_t globus_gsi_cred_get_lifetime(
globus_gsi_cred_handle_t handle,
time_t * lifetime);
globus_result_t globus_gsi_cred_get_goodtill(
globus_gsi_cred_handle_t handle,
time_t * goodtill);
globus_result_t globus_gsi_cred_get_cert_type(
globus_gsi_cred_handle_t handle,
globus_gsi_cert_utils_cert_type_t * type);
globus_result_t globus_gsi_cred_get_key_bits(
globus_gsi_cred_handle_t handle,
int * key_bits);
GLOBUS_DEPRECATED(
globus_result_t globus_gsi_cred_handle_attrs_set_ca_cert_dir(
globus_gsi_cred_handle_attrs_t handle_attrs,
const char * ca_cert_dir));
GLOBUS_DEPRECATED(
globus_result_t globus_gsi_cred_handle_attrs_get_ca_cert_dir(
globus_gsi_cred_handle_attrs_t handle_attrs,
char ** ca_cert_dir));
globus_result_t globus_gsi_cred_handle_attrs_set_search_order(
globus_gsi_cred_handle_attrs_t handle_attrs,
globus_gsi_cred_type_t search_order[]); /*{PROXY,USER,HOST}*/
globus_result_t globus_gsi_cred_handle_attrs_get_search_order(
globus_gsi_cred_handle_attrs_t handle_attrs,
globus_gsi_cred_type_t * search_order[]);/*{PROXY,USER,HOST}*/
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_INCLUDE_GLOBUS_GSI_CREDENTIAL_H */
globus_gsi_cred_constants.h
Globus GSI Credential Library.
globus_gsi_cred_handle_attrs_set_ca_cert_dir
globus_result_t globus_gsi_cred_handle_attrs_set_ca_cert_dir(globus_gsi_cred_handle_attrs_t handle_attrs, const char *ca_cert_dir)
Set the CA certificate directory.
Definition globus_gsi_cred_handle_attrs.c:235
globus_gsi_cred_handle_attrs_set_search_order
globus_result_t globus_gsi_cred_handle_attrs_set_search_order(globus_gsi_cred_handle_attrs_t handle_attrs, globus_gsi_cred_type_t search_order[])
Set the search order.
Definition globus_gsi_cred_handle_attrs.c:347
globus_gsi_cred_handle_attrs_get_search_order
globus_result_t globus_gsi_cred_handle_attrs_get_search_order(globus_gsi_cred_handle_attrs_t handle_attrs, globus_gsi_cred_type_t **search_order)
Get the search order.
Definition globus_gsi_cred_handle_attrs.c:405
globus_gsi_cred_handle_attrs_get_ca_cert_dir
globus_result_t globus_gsi_cred_handle_attrs_get_ca_cert_dir(globus_gsi_cred_handle_attrs_t handle_attrs, char **ca_cert_dir)
Get the CA certificate directory.
Definition globus_gsi_cred_handle_attrs.c:285
globus_gsi_cred_handle_attrs_init
globus_result_t globus_gsi_cred_handle_attrs_init(globus_gsi_cred_handle_attrs_t *handle_attrs)
Initialize credential handle attributes.
Definition globus_gsi_cred_handle_attrs.c:60
globus_gsi_cred_handle_attrs_t
struct globus_l_gsi_cred_handle_attrs_s * globus_gsi_cred_handle_attrs_t
Definition globus_gsi_credential.h:175
globus_gsi_cred_handle_attrs_copy
globus_result_t globus_gsi_cred_handle_attrs_copy(globus_gsi_cred_handle_attrs_t source, globus_gsi_cred_handle_attrs_t *dest)
Copy credential handle attributes.
Definition globus_gsi_cred_handle_attrs.c:159
globus_gsi_cred_handle_attrs_destroy
globus_result_t globus_gsi_cred_handle_attrs_destroy(globus_gsi_cred_handle_attrs_t handle_attrs)
Destroy credential handle attributes.
Definition globus_gsi_cred_handle_attrs.c:123
globus_gsi_cred_get_issuer_name
globus_result_t globus_gsi_cred_get_issuer_name(globus_gsi_cred_handle_t handle, char **issuer_name)
Get issuer name.
Definition globus_gsi_cred_handle.c:1545
globus_gsi_cred_get_lifetime
globus_result_t globus_gsi_cred_get_lifetime(globus_gsi_cred_handle_t handle, time_t *lifetime)
Get credential lifetime.
Definition globus_gsi_cred_handle.c:396
globus_gsi_cred_get_X509_identity_name
globus_result_t globus_gsi_cred_get_X509_identity_name(globus_gsi_cred_handle_t handle, X509_NAME **identity_name)
Get X.509 identity.
Definition globus_gsi_cred_handle.c:1058
globus_gsi_cred_get_cert_chain
globus_result_t globus_gsi_cred_get_cert_chain(globus_gsi_cred_handle_t handle, STACK_OF(X509) **cert_chain)
Get the certificate chain.
Definition globus_gsi_cred_handle.c:919
globus_gsi_cred_verify_cert_chain_when
globus_result_t globus_gsi_cred_verify_cert_chain_when(globus_gsi_cred_handle_t cred_handle, globus_gsi_callback_data_t callback_data, time_t check_time)
Verify credential at a specific time.
Definition globus_gsi_cred_handle.c:1840
globus_gsi_cred_verify_cert_chain
globus_result_t globus_gsi_cred_verify_cert_chain(globus_gsi_cred_handle_t cred_handle, globus_gsi_callback_data_t callback_data)
Verify credential.
Definition globus_gsi_cred_handle.c:1690
globus_gsi_cred_get_identity_name
globus_result_t globus_gsi_cred_get_identity_name(globus_gsi_cred_handle_t handle, char **identity_name)
Get identity name.
Definition globus_gsi_cred_handle.c:1610
globus_gsi_cred_get_policy_languages
globus_result_t globus_gsi_cred_get_policy_languages(globus_gsi_cred_handle_t handle, STACK_OF(ASN1_OBJECT) **languages)
Get certificate chain policy languages.
Definition globus_gsi_cred_handle.c:1367
globus_gsi_cred_get_policies
globus_result_t globus_gsi_cred_get_policies(globus_gsi_cred_handle_t handle, STACK_OF(OPENSSL_STRING) **policies)
Get certificate chain policies.
Definition globus_gsi_cred_handle.c:1207
globus_gsi_cred_handle_destroy
globus_result_t globus_gsi_cred_handle_destroy(globus_gsi_cred_handle_t handle)
Destroy the credential handle.
Definition globus_gsi_cred_handle.c:137
globus_gsi_cred_get_handle_attrs
globus_result_t globus_gsi_cred_get_handle_attrs(globus_gsi_cred_handle_t handle, globus_gsi_cred_handle_attrs_t *handle_attrs)
Get the handle attributes.
Definition globus_gsi_cred_handle.c:291
globus_gsi_cred_set_cert_chain
globus_result_t globus_gsi_cred_set_cert_chain(globus_gsi_cred_handle_t handle, STACK_OF(X509) *cert_chain)
Set the certificate chain.
Definition globus_gsi_cred_handle.c:821
globus_gsi_cred_set_cert
globus_result_t globus_gsi_cred_set_cert(globus_gsi_cred_handle_t handle, X509 *cert)
Set the credential's certificate.
Definition globus_gsi_cred_handle.c:527
globus_gsi_cred_get_cert
globus_result_t globus_gsi_cred_get_cert(globus_gsi_cred_handle_t handle, X509 **cert)
Get the credential's certificate.
Definition globus_gsi_cred_handle.c:597
globus_gsi_cred_get_goodtill
globus_result_t globus_gsi_cred_get_goodtill(globus_gsi_cred_handle_t handle, time_t *goodtill)
Get credential expiration.
Definition globus_gsi_cred_handle.c:351
globus_gsi_cred_get_X509_subject_name
globus_result_t globus_gsi_cred_get_X509_subject_name(globus_gsi_cred_handle_t handle, X509_NAME **subject_name)
Get credential subject name.
Definition globus_gsi_cred_handle.c:995
globus_gsi_cred_set_key
globus_result_t globus_gsi_cred_set_key(globus_gsi_cred_handle_t handle, EVP_PKEY *key)
Set the credential's private key.
Definition globus_gsi_cred_handle.c:656
globus_gsi_cred_get_key
globus_result_t globus_gsi_cred_get_key(globus_gsi_cred_handle_t handle, EVP_PKEY **key)
Get the credential's private key.
Definition globus_gsi_cred_handle.c:744
globus_gsi_cred_handle_copy
globus_result_t globus_gsi_cred_handle_copy(globus_gsi_cred_handle_t source, globus_gsi_cred_handle_t *dest)
Copy a handle.
Definition globus_gsi_cred_handle.c:185
globus_gsi_cred_handle_init
globus_result_t globus_gsi_cred_handle_init(globus_gsi_cred_handle_t *handle, globus_gsi_cred_handle_attrs_t handle_attrs)
Initialize a Handle.
Definition globus_gsi_cred_handle.c:57
globus_gsi_cred_handle_t
struct globus_l_gsi_cred_handle_s * globus_gsi_cred_handle_t
Definition globus_gsi_credential.h:162
globus_gsi_cred_get_X509_issuer_name
globus_result_t globus_gsi_cred_get_X509_issuer_name(globus_gsi_cred_handle_t handle, X509_NAME **issuer_name)
Get credential issuer name object.
Definition globus_gsi_cred_handle.c:1482
globus_gsi_cred_get_key_bits
globus_result_t globus_gsi_cred_get_key_bits(globus_gsi_cred_handle_t handle, int *key_bits)
Get credential strength.
Definition globus_gsi_cred_handle.c:441
globus_gsi_cred_verify
globus_result_t globus_gsi_cred_verify(globus_gsi_cred_handle_t handle)
Verify a credential.
Definition globus_gsi_cred_handle.c:2042
globus_gsi_cred_get_subject_name
globus_result_t globus_gsi_cred_get_subject_name(globus_gsi_cred_handle_t handle, char **subject_name)
Get credential subject name.
Definition globus_gsi_cred_handle.c:1145
globus_gsi_cred_read_proxy_bio
globus_result_t globus_gsi_cred_read_proxy_bio(globus_gsi_cred_handle_t handle, BIO *bio)
Read proxy credential from a BIO.
Definition globus_gsi_credential.c:894
globus_gsi_cred_read_key
globus_result_t globus_gsi_cred_read_key(globus_gsi_cred_handle_t handle, const char *key_filename, pem_password_cb *pw_cb)
Read a private key.
Definition globus_gsi_credential.c:1127
globus_gsi_cred_read_cert_bio
globus_result_t globus_gsi_cred_read_cert_bio(globus_gsi_cred_handle_t handle, BIO *bio)
Read a certificate chain from a BIO.
Definition globus_gsi_credential.c:1269
globus_gsi_cred_write_proxy
globus_result_t globus_gsi_cred_write_proxy(globus_gsi_cred_handle_t handle, const char *proxy_filename)
Write a proxy credential.
Definition globus_gsi_credential.c:1850
globus_gsi_cred_get_cert_type
globus_result_t globus_gsi_cred_get_cert_type(globus_gsi_cred_handle_t handle, globus_gsi_cert_utils_cert_type_t *type)
Get the X.509 certificate type.
Definition globus_gsi_credential.c:1979
globus_gsi_cred_read_cert
globus_result_t globus_gsi_cred_read_cert(globus_gsi_cred_handle_t handle, const char *cert_filename)
Read a certificate chain from a file.
Definition globus_gsi_credential.c:1212
globus_gsi_cred_read_cert_buffer
globus_result_t globus_gsi_cred_read_cert_buffer(const char *pem_buf, globus_gsi_cred_handle_t *out_handle, X509 **out_cert, STACK_OF(X509) **out_cert_chain, char **out_subject)
Read certificate chain from a buffer.
Definition globus_gsi_credential.c:1392
globus_gsi_cred_write
globus_result_t globus_gsi_cred_write(globus_gsi_cred_handle_t handle, BIO *bio)
Write Credential.
Definition globus_gsi_credential.c:1766
globus_gsi_cred_read_proxy
globus_result_t globus_gsi_cred_read_proxy(globus_gsi_cred_handle_t handle, const char *proxy_filename)
Read proxy credential.
Definition globus_gsi_credential.c:823
globus_gsi_cred_read_pkcs12
globus_result_t globus_gsi_cred_read_pkcs12(globus_gsi_cred_handle_t handle, const char *pkcs12_filename)
Read certificate and key from a PKCS12 file.
Definition globus_gsi_credential.c:1519
globus_gsi_cred_read
globus_result_t globus_gsi_cred_read(globus_gsi_cred_handle_t handle, X509_NAME *desired_subject)
Read a credential.
Definition globus_gsi_credential.c:200
globus_gsi_cred_type_t
globus_gsi_cred_type_t
Definition globus_gsi_cred_constants.h:105