---
title: TKTokenKeyAlgorithm
framework: cryptotokenkit
role: symbol
role_heading: Class
path: cryptotokenkit/tktokenkeyalgorithm
---

# TKTokenKeyAlgorithm

Cryptographic algorithms used by token keys.

## Declaration

```swift
class TKTokenKeyAlgorithm
```

## Overview

Overview Typically, the supported algorithm for a token key can be represented by a value of the SecKeyAlgorithm enumeration. However, tokens such as Smart Cards require that input data for operations take the format of a more specific algorithm. For example, a token may accept raw data to generate a cryptographic signature, but require that raw data to be formatted according to PKCS1 padding rules. To express such a requirement, a TKTokenKeyAlgorithm object defines a target algorithm and a set of other algorithms that were used. In the previous example, the target algorithm is kSecKeyAlgorithmRSASignatureRaw and the kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1 algorithm is also reported as being  used.

## Topics

### Determining Algorithm Usage

- [isAlgorithm(_:)](cryptotokenkit/tktokenkeyalgorithm/isalgorithm(_:).md)
- [supportsAlgorithm(_:)](cryptotokenkit/tktokenkeyalgorithm/supportsalgorithm(_:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Determining Support for Operations

- [tokenSession(_:supports:keyObjectID:algorithm:)](cryptotokenkit/tktokensessiondelegate/tokensession(_:supports:keyobjectid:algorithm:).md)
- [TKTokenOperation](cryptotokenkit/tktokenoperation.md)
- [TKToken.ObjectID](cryptotokenkit/tktoken/objectid.md)
