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

# GSSCredentialGetLifetime(_:)

Returns the remaining time in seconds before the credential expires.

## Declaration

```swift
func GSSCredentialGetLifetime(_ cred: gss_cred_id_t) -> OM_uint32
```

## Parameters

- `cred`: The credential to inspect.

## Return Value

Return Value The time in seconds that the credential has before it expires. The time is 0 if the call fails, or GSS_C_INDEFINITE if the credential never expires.

## See Also

### Inquiries

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