---
title: "SecKeychainCopyDefault(_:)"
framework: security
role: symbol
role_heading: Function
path: "security/seckeychaincopydefault(_:)"
---

# SecKeychainCopyDefault(_:)

Retrieves a pointer to the default keychain.

## Declaration

```swift
func SecKeychainCopyDefault(_ keychain: UnsafeMutablePointer<SecKeychain?>) -> OSStatus
```

## Parameters

- `keychain`: On return, a pointer to the default keychain object. In Objective-C, call the doc://com.apple.documentation/documentation/CoreFoundation/CFRelease function to release this object when you are finished using it.

## Return Value

Return Value A result code. See Security Framework Result Codes. The result code errSecNoDefaultKeychain indicates that there is no default keychain.
