---
title: "key(forObjectID:)"
framework: cryptotokenkit
role: symbol
role_heading: Instance Method
path: "cryptotokenkit/tktokenkeychaincontents/key(forobjectid:)"
---

# key(forObjectID:)

Returns the key for a specified object identifier.

## Declaration

```swift
func key(forObjectID objectID: TKToken.ObjectID) throws -> TKTokenKeychainKey
```

## Parameters

- `objectID`: The object identifier for the keychain item.

## Return Value

Return Value The key, or nil if no key exists.

## See Also

### Accessing Keychain Items

- [items](cryptotokenkit/tktokenkeychaincontents/items.md)
- [certificate(forObjectID:)](cryptotokenkit/tktokenkeychaincontents/certificate(forobjectid:).md)
