---
title: "gss_import_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_import_cred(_:_:_:)"
---

# gss_import_cred(_:_:_:)

Imports a credential from a token.

## Declaration

```swift
func gss_import_cred(_ minor_status: UnsafeMutablePointer<OM_uint32>, _ token: gss_buffer_t, _ cred_handle: UnsafeMutablePointer<gss_cred_id_t?>) -> OM_uint32
```

## Parameters

- `minor_status`: A pointer to the secondary status result that provides additional information in case of failure.
- `token`: The token containing the data that represents the credential.
- `cred_handle`: A pointer to a credential that the function uses to return the credential. Free the credential’s memory with doc://com.apple.gss/documentation/GSS/gss_release_cred(_:_:) when you are done with it.

## 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 You can import a credential from a token created with gss_export_cred(_:_:_:).

## See Also

### Import and Export

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