---
title: "gss_inquire_cred(_:_:_:_:_:_:)"
framework: GSS
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.1+, macOS 10.7+, visionOS 1.0+]
path: "gss/gss_inquire_cred(_:_:_:_:_:_:)"
---

# gss_inquire_cred(_:_:_:_:_:_:)

Obtains information about a credential.

## Declaration

```swift
func gss_inquire_cred(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ cred_handle: gss_cred_id_t?, _ name_ret: UnsafeMutablePointer<gss_name_t?>?, _ lifetime: UnsafeMutablePointer<OM_uint32>?, _ cred_usage: UnsafeMutablePointer<gss_cred_usage_t>?, _ mechanisms: UnsafeMutablePointer<gss_OID_set?>?) -> OM_uint32
```

## Parameters

- `minor_status`: A pointer to the secondary status result that provides additional information in case of failure.
- `cred_handle`: The credential to inspect. Use doc://com.apple.gss/documentation/GSS/GSS_C_NO_CREDENTIAL to inquire about the default initiator principal.
- `name_ret`: A pointer the function uses to return the name that the credential asserts. Use doc://com.apple.gss/documentation/GSS/gss_release_name(_:_:) to free the name object’s memory when you are done with it. Set the parameter to NULL to ignore this output.
- `lifetime`: A pointer the function uses to return the number of seconds for which the credential will remain valid, or 0 if the credential is expired. For credentials that do not support expiry, the function returns doc://com.apple.gss/documentation/GSS/GSS_C_INDEFINITE. Set to NULL to ignore this output.
- `cred_usage`: A pointer the function uses to return the credential usage. The value is one of doc://com.apple.gss/documentation/GSS/GSS_C_ACCEPT, doc://com.apple.gss/documentation/GSS/GSS_C_INITIATE, or doc://com.apple.gss/documentation/GSS/GSS_C_BOTH. Set to NULL to ignore this output.
- `mechanisms`: A pointer the function uses to return the set of mechanisms that the credential supports. Use doc://com.apple.gss/documentation/GSS/gss_release_oid_set(_:_:) to free the set’s memory when you are done with it. Set the parameter to NULL to ignore this output.

## Return Value

Return Value A status code set to GSS_S_COMPLETE on success. See Function Status for a description of other status outputs.

## See Also

### Inquiries

- [gss_inquire_cred_by_mech(_:_:_:_:_:_:_:)](gss/gss_inquire_cred_by_mech(_:_:_:_:_:_:_:).md)
- [gss_inquire_cred_by_oid(_:_:_:_:)](gss/gss_inquire_cred_by_oid(_:_:_:_:).md)
- [GSSCredentialGetLifetime(_:)](gss/gsscredentialgetlifetime(_:).md)
