<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/AES/KeyWrap/unwrap(_:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit3AESO7KeyWrapO6unwrap_5usingAA09SymmetricD0Vx_AItK10Foundation12DataProtocolRzlFZ"
  },
  "title" : "unwrap(_:using:)"
}
-->

# unwrap(_:using:)

Unwraps a key using the AES wrap algorithm.

```
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

The unwrapped key.

## 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)