---
title: SecKey
framework: security
role: symbol
role_heading: Class
path: security/seckey
---

# SecKey

An object that represents a cryptographic key.

## Declaration

```swift
class SecKey
```

## Mentioned in

Getting an Existing Key

## Overview

Overview A SecKey instance that represents a key that is stored in a keychain can be safely cast to a SecKeychainItem for manipulation as a keychain item. On the other hand, if the key is not stored in a keychain, casting the object to a SecKeychainItem and passing it to Keychain Services functions returns errors.

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
