deriveKey(inputKeyMaterial:salt:outputByteCount:)

Derives a symmetric encryption key from a main key or passcode using HKDF key derivation with salt that you specify.

HKDF.swift:83
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
static func deriveKey<Salt>(inputKeyMaterial: SymmetricKey, salt: Salt, outputByteCount: Int) -> SymmetricKey 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.

outputByteCount

The length in bytes of the resulting symmetric key.

Returns

The derived symmetric key.