.TH "globus_gsi_cred_operations" 3 "Version 8.4" "globus_gsi_credential" \" -*- nroff -*- .ad l .nh .SH NAME globus_gsi_cred_operations \- Credential Operations .PP \- Credential Operations\&. .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read\fP (\fBglobus_gsi_cred_handle_t\fP handle, X509_NAME *desired_subject)" .br .RI "Read a credential\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_proxy\fP (\fBglobus_gsi_cred_handle_t\fP handle, const char *proxy_filename)" .br .RI "Read proxy credential\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_proxy_bio\fP (\fBglobus_gsi_cred_handle_t\fP handle, BIO *bio)" .br .RI "Read proxy credential from a BIO\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_key\fP (\fBglobus_gsi_cred_handle_t\fP handle, const char *key_filename, int(*pw_cb)())" .br .RI "Read a private key\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_cert\fP (\fBglobus_gsi_cred_handle_t\fP handle, const char *cert_filename)" .br .RI "Read a certificate chain from a file\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_cert_bio\fP (\fBglobus_gsi_cred_handle_t\fP handle, BIO *bio)" .br .RI "Read a certificate chain from a BIO\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_cert_buffer\fP (const char *pem_buf, \fBglobus_gsi_cred_handle_t\fP *out_handle, X509 **out_cert, STACK_OF(X509) **out_cert_chain, char **out_subject)" .br .RI "Read certificate chain from a buffer\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_read_pkcs12\fP (\fBglobus_gsi_cred_handle_t\fP handle, const char *pkcs12_filename)" .br .RI "Read certificate and key from a PKCS12 file\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_write\fP (\fBglobus_gsi_cred_handle_t\fP handle, BIO *bio)" .br .RI "Write Credential\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_write_proxy\fP (\fBglobus_gsi_cred_handle_t\fP handle, const char *proxy_filename)" .br .RI "Write a proxy credential\&. " .ti -1c .RI "globus_result_t \fBglobus_gsi_cred_get_cert_type\fP (\fBglobus_gsi_cred_handle_t\fP handle, globus_gsi_cert_utils_cert_type_t *type)" .br .RI "Get the X\&.509 certificate type\&. " .in -1c .SH "Detailed Description" .PP Credential Operations\&. Read/Write a GSI Credential Handle\&. .PP This section defines operations to read and write GSI Credential handles\&. .SH "Function Documentation" .PP .SS "globus_result_t globus_gsi_cred_get_cert_type (\fBglobus_gsi_cred_handle_t\fP handle, globus_gsi_cert_utils_cert_type_t * type)" .PP Get the X\&.509 certificate type\&. Determine the type of the given X509 certificate For the list of possible values returned, see globus_gsi_cert_utils_cert_type_t\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential handle containing the certificate .br \fItype\fP The returned X509 certificate type .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error captured in a globus_result_t .RE .PP .SS "globus_result_t globus_gsi_cred_read (\fBglobus_gsi_cred_handle_t\fP handle, X509_NAME * desired_subject)" .PP Read a credential\&. Read a credential from a filesystem location\&. The credential to read will be determined by the search order specified in the handle attributes\&. .br .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential handle to set\&. This credential handle should already be initialized using globus_gsi_cred_handle_init\&. .br \fIdesired_subject\fP The subject to check for when reading in a credential\&. The desired_subject should be either a exact match of the read cert's subject or should just contain the /CN entry\&. If null, the credential read in is the first match based on the system configuration (paths and environment variables) .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS if no errors occurred, otherwise, an error object identifier is returned\&. .RE .PP \fBSee also\fP .RS 4 \fBglobus_gsi_cred_read_proxy()\fP .PP globus_gsi_cred_read_cert_and_key() .RE .PP \fBNote\fP .RS 4 This function always searches for the desired credential\&. If you don't want to perform a search, then don't use this function\&. The search goes in the order of the handle attributes' search order\&. .RE .PP .SS "globus_result_t globus_gsi_cred_read_cert (\fBglobus_gsi_cred_handle_t\fP handle, const char * cert_filename)" .PP Read a certificate chain from a file\&. Read a cert from a file\&. Cert should be in PEM format\&. Will also read additional certificates as chain if present\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP the handle to set based on the certificate that is read .br \fIcert_filename\fP the filename of the certificate to read .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_cert_bio (\fBglobus_gsi_cred_handle_t\fP handle, BIO * bio)" .PP Read a certificate chain from a BIO\&. Read a cert from a BIO\&. Cert should be in PEM format\&. Will also read additional certificates as chain if present\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP the handle to set based on the certificate that is read .br \fIbio\fP the bio to read the certificate from .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_cert_buffer (const char * pem_buf, \fBglobus_gsi_cred_handle_t\fP * out_handle, X509 ** out_cert, STACK_OF(X509) ** out_cert_chain, char ** out_subject)" .PP Read certificate chain from a buffer\&. Read a cert from a buffer\&. Cert should be in PEM format\&. Will also read additional certificates as chain if present\&. Any parameter besides pem_buf may be NULL\&. .PP \fBParameters\fP .RS 4 \fIpem_buf\fP The buffer containing the PEM formatted cert and chain\&. .br \fIout_handle\fP The handle to initialize and set cert on\&. .br \fIout_cert\fP The X509 certificate\&. This should be freed with X509_free()\&. .br \fIout_cert_chain\fP The X509 certificate chain\&. This should be freed with sk_X509_free()\&. .br \fIout_subject\fP The identity name of the cert\&. This should be freed with OPENSSL_free()\&. .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_key (\fBglobus_gsi_cred_handle_t\fP handle, const char * key_filename, int(*)() pw_cb)" .PP Read a private key\&. Read a key from a PEM file\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP the handle to set based on the key that is read .br \fIkey_filename\fP the filename of the key to read .br \fIpw_cb\fP the callback for obtaining a password for decrypting the key\&. .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_pkcs12 (\fBglobus_gsi_cred_handle_t\fP handle, const char * pkcs12_filename)" .PP Read certificate and key from a PKCS12 file\&. Read a cert and key from a file\&. The file should be in PKCS12 format\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP the handle to populate with the read credential .br \fIpkcs12_filename\fP the filename containing the credential to read .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_proxy (\fBglobus_gsi_cred_handle_t\fP handle, const char * proxy_filename)" .PP Read proxy credential\&. Read a proxy from a PEM file\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential handle to set based on the proxy credential read from the file .br \fIproxy_filename\fP The file containing the proxy credential .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS or an error object identifier .RE .PP .SS "globus_result_t globus_gsi_cred_read_proxy_bio (\fBglobus_gsi_cred_handle_t\fP handle, BIO * bio)" .PP Read proxy credential from a BIO\&. Read a Proxy Credential from a BIO stream and set the credential handle to represent the read credential\&. The values read from the stream, in order, will be the signed certificate, the private key, and the certificate chain\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential handle to set\&. The credential should handle be initialized (i\&.e\&. not NULL)\&. .br \fIbio\fP The stream to read the credential from .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS unless an error occurred, in which case an error object is returned .RE .PP .SS "globus_result_t globus_gsi_cred_write (\fBglobus_gsi_cred_handle_t\fP handle, BIO * bio)" .PP Write Credential\&. Write out a credential to a BIO\&. The credential parameters written, in order, are the signed certificate, the RSA private key, and the certificate chain (a set of X509 certificates)\&. the credential is written out in PEM format\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential to write out .br \fIbio\fP The BIO stream to write out to .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS unless an error occurred, in which case an error object ID is returned\&. .RE .PP .SS "globus_result_t globus_gsi_cred_write_proxy (\fBglobus_gsi_cred_handle_t\fP handle, const char * proxy_filename)" .PP Write a proxy credential\&. Write out a credential to a file\&. The credential parameters written, in order, are the signed certificate, the RSA private key, and the certificate chain (a set of X509 certificates)\&. the credential is written out in PEM format\&. .PP \fBParameters\fP .RS 4 \fIhandle\fP The credential to write out .br \fIproxy_filename\fP The file to write out to .RE .PP \fBReturns\fP .RS 4 GLOBUS_SUCCESS unless an error occurred, in which case an error object ID is returned\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for globus_gsi_credential from the source code\&.