---
title: "gss_iter_creds(_:_:_:_:)"
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_iter_creds(_:_:_:_:)"
---

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

Iterates over all credentials.

## Declaration

```swift
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 doc://com.apple.gss/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

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

## Discussion

Discussion Use the gss_iter_creds_f(_:_:_:_:_:) function if you want to track the callbacks using a user-supplied context.

## See Also

### Iteration

- [gss_iter_creds_f(_:_:_:_:_:)](gss/gss_iter_creds_f(_:_:_:_:_:).md)
