---
title: SymmetricKeySize
framework: cryptokit
role: symbol
role_heading: Structure
path: cryptokit/symmetrickeysize
---

# SymmetricKeySize

The sizes that a symmetric cryptographic key can take.

## Declaration

```swift
struct SymmetricKeySize
```

## Overview

Overview When creating a new SymmetricKey instance with a call to its init(size:) initializer, you typically use one of the standard key sizes, like bits128, bits192, or bits256. When you need a key with a non-standard length, use the init(bitCount:) initializer to create a SymmetricKeySize instance with a custom bit count.

## Topics

### Using standard key lengths

- [bits128](cryptokit/symmetrickeysize/bits128.md)
- [bits192](cryptokit/symmetrickeysize/bits192.md)
- [bits256](cryptokit/symmetrickeysize/bits256.md)

### Creating a nonstandard key length

- [init(bitCount:)](cryptokit/symmetrickeysize/init(bitcount:).md)

### Getting the length

- [bitCount](cryptokit/symmetrickeysize/bitcount.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Message authentication codes

- [HMAC](cryptokit/hmac.md)
- [SymmetricKey](cryptokit/symmetrickey.md)
