---
title: "init(data:)"
framework: cryptokit
role: symbol
role_heading: Initializer
path: "cryptokit/symmetrickey/init(data:)"
---

# init(data:)

Creates a key from the given data.

## Declaration

```swift
init<D>(data: D) where D : ContiguousBytes
```

## Parameters

- `data`: The contiguous bytes from which to create the key.

## See Also

### Creating a key

- [init(size:)](cryptokit/symmetrickey/init(size:).md)
