---
title: "wrap(_:using:)"
framework: cryptokit
role: symbol
role_heading: Type Method
path: "cryptokit/aes/keywrap/wrap(_:using:)"
---

# wrap(_:using:)

Wraps a key using the AES wrap algorithm.

## Declaration

```swift
static func wrap(_ keyToWrap: SymmetricKey, using kek: SymmetricKey) throws -> Data
```

## Parameters

- `keyToWrap`: The key to wrap.
- `kek`: The key encryption key.

## Return Value

Return Value The wrapped key.

## Discussion

Discussion Wrap is an implementation of the AES key wrap algorithm as specified in IETF RFC 3394.
