<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKTokenKeychainKey",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKTokenKeychainKey"
  },
  "title" : "TKTokenKeychainKey"
}
-->

# TKTokenKeychainKey

A token’s key as stored in the keychain.

```
class TKTokenKeychainKey
```

## Topics

### Creating Token Keychain Keys

[`-  initWithCertificate:objectID:`](/documentation/CryptoTokenKit/TKTokenKeychainKey/init(certificate:objectID:))

Initializes a token keychain key with data from the specified certificate reference and a given object ID.

### Accessing Key Attributes

[`keyType`](/documentation/CryptoTokenKit/TKTokenKeychainKey/keyType)

The type of the key. Currently, only <doc://com.apple.documentation/documentation/Security/kSecAttrKeyTypeRSA> and `kSecAttrKeyTypeECSECPrimeRandom` are supported values.

[`keySizeInBits`](/documentation/CryptoTokenKit/TKTokenKeychainKey/keySizeInBits)

[`applicationTag`](/documentation/CryptoTokenKit/TKTokenKeychainKey/applicationTag)

The private tag data.

[`publicKeyData`](/documentation/CryptoTokenKit/TKTokenKeychainKey/publicKeyData)

The public key data.

[`publicKeyHash`](/documentation/CryptoTokenKit/TKTokenKeychainKey/publicKeyHash)

The SHA1 hash of the raw public key.

[`canDecrypt`](/documentation/CryptoTokenKit/TKTokenKeychainKey/canDecrypt)

Whether the key can be used to decrypt data.

[`canSign`](/documentation/CryptoTokenKit/TKTokenKeychainKey/canSign)

Whether the key can be used to sign data.

[`canPerformKeyExchange`](/documentation/CryptoTokenKit/TKTokenKeychainKey/canPerformKeyExchange)

Whether the key can be used to perform Diffie-Hellman style cryptographic key exchange.

[`suitableForLogin`](/documentation/CryptoTokenKit/TKTokenKeychainKey/isSuitableForLogin)

Whether the key can be used for system login.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`TKTokenKeychainItem`](/documentation/CryptoTokenKit/TKTokenKeychainItem)

---

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)