Contents

deriveKey(inputKeyMaterial:salt:info:outputByteCount:)

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

Declaration

static func deriveKey<Salt, Info>(inputKeyMaterial: SymmetricKey, salt: Salt, info: Info, outputByteCount: Int) -> SymmetricKey where Salt : DataProtocol, Info : DataProtocol

Parameters

  • inputKeyMaterial:

    The main key or passcode the derivation function uses to derive a key.

  • salt:

    The salt to use for key derivation.

  • info:

    The shared information to use for key derivation.

  • outputByteCount:

    The length in bytes of the resulting symmetric key.

Return Value

The derived symmetric key.

See Also

Deriving a key