---
title: "extract(inputKeyMaterial:salt:)"
framework: cryptokit
role: symbol
role_heading: Type Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, visionOS 1.0+, watchOS 7.0+]
path: "cryptokit/hkdf/extract(inputkeymaterial:salt:)-4f5wf"
---

# extract(inputKeyMaterial:salt:)

Creates cryptographically strong key material from a main key or passcode that you specify.

## Declaration

```swift
static func extract<Salt>(inputKeyMaterial: SymmetricKey, salt: Salt?) -> HashedAuthenticationCode<H> where Salt : DataProtocol
```

## Parameters

- `inputKeyMaterial`: The main key or passcode the derivation function uses to derive a key.
- `salt`: The salt to use for key derivation.

## Return Value

Return Value A pseudorandom, cryptographically strong key in the form of a hashed authentication code.

## Discussion

Discussion Generate a derived symmetric key from the cryptographically strong key material this function creates by calling expand(pseudoRandomKey:info:outputByteCount:).
