<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GSS",
  "identifier" : "/documentation/GSS/GSSCredentialGetLifetime(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@GSSCredentialGetLifetime"
  },
  "title" : "GSSCredentialGetLifetime(_:)"
}
-->

# GSSCredentialGetLifetime(_:)

Returns the remaining time in seconds before the credential expires.

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

## Parameters

`cred`

The credential to inspect.

## 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`](/documentation/GSS/GSS_C_INDEFINITE) if the credential never expires.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)