---
title: SecKeyGetCSSMKey
framework: security
role: symbol
role_heading: Function
path: security/seckeygetcssmkey
---

# SecKeyGetCSSMKey

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

## Declaration

```occ
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

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

## Discussion

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.
