<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "Security",
  "identifier" : "/documentation/Security/SecKeyGetCSSMKey",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Security"
    ],
    "preciseIdentifier" : "c:@F@SecKeyGetCSSMKey"
  },
  "title" : "SecKeyGetCSSMKey"
}
-->

# SecKeyGetCSSMKey

Retrieves a pointer to the `CSSM_KEY` structure containing the key stored in a keychain item.

```
OSStatus SecKeyGetCSSMKey(SecKeyRef key, const CSSM_KEY **cssmKey);
```

## Parameters

`key`

A keychain key item object.

`cssmKey`

A pointer to a `CSSM_KEY` structure for the specified key. You should not modify or free this data, because it is owned by the system.

## Return Value

A result code. See [Security Framework Result Codes](/documentation/Security/security-framework-result-codes).

## Discussion

The `CSSM_KEY` structure is used to represent keys in CSSM and is used as an input value to several CSSM functions. The `CSSM_KEY` structure is valid until the keychain item object is released.

---

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)