<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecurityInterface",
  "identifier" : "/documentation/SecurityInterface/SFKeychainSavePanel/setPassword(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Security Interface"
    ],
    "preciseIdentifier" : "c:objc(cs)SFKeychainSavePanel(im)setPassword:"
  },
  "title" : "setPassword(_:)"
}
-->

# setPassword(_:)

Specifies the password for the keychain that will be created.

```
func setPassword(_ password: String!)
```

## Parameters

`password`

The password to be used for the new keychain.

## Discussion

This method is optional. If you don’t call this method, the keychain save panel displays a password-entry dialog.

---

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)