---
name: "globus_gsi_cert_utils"
section: "3"
platform: "linux"
package: "libglobus-gsi-cert-utils-doc"
version: "10.11-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/globus_gsi_cert_utils"
---

# globus\_gsi\_cert\_utils(3)

Globus GSI Certificate Handling Utilities - Globus GSI Certificate Handling Utilities.

## NAME

globus\_gsi\_cert\_utils - Globus GSI Certificate Handling Utilities

 \- Globus GSI Certificate Handling Utilities.

## SYNOPSIS

### Modules

**Activation**\
 Activation.  **Cert Utils Constants**\
 Cert Utils Constants.

### Functions

globus\_result\_t **globus\_gsi\_cert\_utils\_make\_time** (const ASN1\_TIME \*ctm, time\_t \*newtime)\
 Convert ASN1\_TIME to time\_t.  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.  globus\_result\_t **globus\_gsi\_cert\_utils\_get\_x509\_name** (const char \*subject\_string, int length, X509\_NAME \*x509\_name)\
 Get the certificate name.  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.  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.  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.

## Detailed Description

Globus GSI Certificate Handling Utilities.

The Globus GSI Certificate Handling Utilities library. This library contains helper functions for dealing with certificates.

- •

  **Activation**

- •

  **Globus GSI Certificate Handling Utilities**

- •

  **Cert Utils Constants**

## Function Documentation

### 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. Get the base name of a proxy certificate. Given an X509 name, strip off the proxy related /CN components to get the base name of the certificate's subject

**Parameters**

*subject* Pointer to an X509\_NAME object which gets stripped \
 *cert\_chain* The certificate chain used to detect the number of CNs to strip. This is done by figuring out the number of proxies in the chain.

**Returns**

GLOBUS\_SUCCESS

### 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. Determine the type of the given X509 certificate For the list of possible values returned, see globus\_gsi\_cert\_utils\_cert\_type\_t.

**Parameters**

*cert* The X509 certificate \
 *type* The returned X509 certificate type

**Returns**

GLOBUS\_SUCCESS or an error captured in a globus\_result\_t

### 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. Get the end-entity certificate associated with a certificate chain

**Parameters**

*cert\_chain* Certificate chain to inspect. \
 *eec* Pointer to be set to the EEC value from within the cert chain. Must freed by the caller.

### 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. Get the identity-providing certificate associated with a certificate chain. This may be an independent proxy or a end-entity certificate.

**Parameters**

*cert\_chain* Certificate chain to inspect. \
 *identity\_cert* Pointer to be set to the certificate value from within the cert chain. Must freed by the caller.

### globus\_result\_t globus\_gsi\_cert\_utils\_get\_x509\_name (const char \* subject\_string, int length, X509\_NAME \* x509\_name)

Get the certificate name. Get the X509\_NAME from a subject string. OpenSSL doesn't provide this function, probably because it shouldn't be used. If you are getting an X509\_NAME from just a string, its impossible to verify its integrity.

**Parameters**

*subject\_string* The subject in the format: '/O=Grid/OU=...' \
 *length* The length of the subject string \
 *x509\_name* The resulting X509\_NAME object

**Returns**

GLOBUS\_SUCCESS unless an error occurred, in which case, a globus error object ID is returned

### globus\_result\_t globus\_gsi\_cert\_utils\_make\_time (const ASN1\_TIME \* ctm, time\_t \* newtime)

Convert ASN1\_TIME to time\_t. Convert a ASN1\_TIME structure to a time\_t

**Parameters**

*ctm* The ASN1\_TIME to convert \
 *newtime* The converted time

**Returns**

GLOBUS\_SUCCESS or GLOBUS\_FAILURE on error

## Author

Generated automatically by Doxygen for globus\_gsi\_cert\_utils from the source code.
