---
title: "SecKeychainGetPath(_:_:_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychaingetpath(_:_:_:)"
---

# SecKeychainGetPath(_:_:_:)

Determines the path of a keychain.

## Declaration

```swift
func SecKeychainGetPath(_ keychain: SecKeychain?, _ ioPathLength: UnsafeMutablePointer<UInt32>, _ pathName: UnsafeMutablePointer<CChar>) -> OSStatus
```

## Parameters

- `keychain`: A reference to a keychain whose path you wish to obtain.
- `ioPathLength`: On entry, a pointer to a variable containing the length (in bytes) of the buffer specified by pathName. On return, the string length of pathName, not including the null termination.
- `pathName`: On entry, a pointer to a buffer that you have allocated. On return, the buffer contains POSIX path of the keychain as a null-terminated UTF-8 encoded string. The function returns doc://com.apple.security/documentation/Security/errSecBufferTooSmall if the provided buffer is too small to hold the string with the null terminator byte.

## Return Value

Return Value A result code. See Security Framework Result Codes.
