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

# gss_iter_creds(_:_:_:_:)

Iterates over all credentials.

```
func gss_iter_creds(_ min_stat: UnsafeMutablePointer<OM_uint32>, _ flags: OM_uint32, _ mech: gss_const_OID?, _ useriter: @escaping (gss_OID?, gss_cred_id_t?) -> Void) -> OM_uint32
```

## Parameters

`flags`

No flags are currently defined. Pass 0 for this parameter.

`mech`

The mechanism type of credentials to iterate over. Pass in `GSS_C_NO_OID_SET` to iterate over all credentials.

`useriter`

A block that is called once for each credential. The block receives the credential’s mechanism and a copy of the credential as input on each iteration. Free the copy’s memory with a call to [`gss_release_cred(_:_:)`](/documentation/GSS/gss_release_cred(_:_:)) when you are done with it. The block is called one final time with `NULL` inputs upon reaching the end of the list.

## Return Value

A status code set to [`GSS_S_COMPLETE`](/documentation/GSS/GSS_S_COMPLETE) on success. See [Function Status](/documentation/GSS/function-status) for a description of other status outputs.

## Discussion

Use the [`gss_iter_creds_f(_:_:_:_:_:)`](/documentation/GSS/gss_iter_creds_f(_:_:_:_:_:)) function if you want to track the callbacks using a user-supplied context.

---

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)