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

# unwrap(_:using:)

Unwraps a key using the AES wrap algorithm.

## Declaration

```swift
static func unwrap<WrappedKey>(_ wrappedKey: WrappedKey, using kek: SymmetricKey) throws -> SymmetricKey where WrappedKey : DataProtocol
```

## Parameters

- `wrappedKey`: The key to unwrap.
- `kek`: The key encryption key.

## Return Value

Return Value The unwrapped key.

## Discussion

Discussion Wrap is an implementation of the AES key wrap algorithm as specified in IETF RFC 3394. The method throws an error is the key was incorrectly wrapped.
