<!--
{
  "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/GSSCreateName(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "GSS"
    ],
    "preciseIdentifier" : "c:@F@GSSCreateName"
  },
  "title" : "GSSCreateName(_:_:_:)"
}
-->

# GSSCreateName(_:_:_:)

Returns a GSS name given a buffer and a type.

```
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 [`GSS_C_NT_USER_NAME`](/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

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

---

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)