<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASAuthorizationProviderExtensionLoginManager/key(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "c:objc(cs)ASAuthorizationProviderExtensionLoginManager(im)copyKeyForKeyType:"
  },
  "title" : "key(for:)"
}
-->

# key(for:)

Retrieves the key for the specified platform single sign-on key type.

```
func key(for keyType: ASAuthorizationProviderExtensionKeyType) -> SecKey?
```

## Parameters

`keyType`

The key type to retrieve.

## Return Value

The key identity if it exists, or `nil` if it doesn’t.

---

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)