extract(inputKeyMaterial:salt:)

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

HKDF.swift:117
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
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.

Returns

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

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