---
title: "GSSCreateName(_:_:_:)"
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/gsscreatename(_:_:_:)"
---

# GSSCreateName(_:_:_:)

Returns a GSS name given a buffer and a type.

## Declaration

```swift
func GSSCreateName(_ name: CFTypeRef, _ name_type: gss_const_OID, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> gss_name_t?
```

## Parameters

- `name`: A name buffer describing the credential. The buffer is either a CFDataRef or a CFStringRef containing the name.
- `name_type`: An OID name type constant, such as doc://com.apple.gss/documentation/GSS/GSS_C_NT_USER_NAME.
- `error`: A CFErrorRef pointer that the function sets to point at a new error object if the function call fails, or NULL to ignore the error. If the error exists, it describes the reason for the failure, and you are responsible for releasing it with CFRelease.

## Return Value

Return Value A GSS name for the given buffer and type, or NULL on failure. Release this object with a call to gss_release_name(_:_:) when you are done with it.

## See Also

### Creation and Destruction

- [gss_name_t](gss/gss_name_t.md)
- [gss_const_name_t](gss/gss_const_name_t.md)
- [gss_canonicalize_name(_:_:_:_:)](gss/gss_canonicalize_name(_:_:_:_:).md)
- [GSSNameCreateDisplayString(_:)](gss/gssnamecreatedisplaystring(_:).md)
- [gss_release_name(_:_:)](gss/gss_release_name(_:_:).md)
