One Logo Pool Ball
CryptoKit · IOS API REFERENCE

HMAC

struct · iOS 13.0+ · SDK 27.1

struct HMAC<H> where H : HashFunction

A hash-based message authentication algorithm. Use hash-based message authentication to create a code with a value that’s dependent on both a block of data and a symmetric cryptographic key. Another party with access to the data and the same secret key can compute the code again and compare it to the original to detect whether the data changed. This serves a purpose similar to digital signing and verification, but depends on a shared symmetric key instead of public-key cryptography. As with digital signing, the data isn’t hidden by this process. When you need to encrypt the data as well as authenticate it, use a cipher like ``AES`` or ``ChaChaPoly`` to put the data into a sealed box (an instance of ``AES/GCM/SealedBox`` or ``ChaChaPoly/SealedBox``).

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

8 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

HMAC.isValidAuthenticationCode(_:authenticating:using:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.init(key:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.authenticationCode(for:using:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.authenticationCode(for:using:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.isValidAuthenticationCode(_:authenticating:using:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.isValidAuthenticationCode(_:authenticating:using:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.update(data:)

The containing type needs Swift generic type arguments. (no canonical witness for H)

HMAC.update(bytes:)

The iOS SDK compiler rejected this binding: instance method 'arg' requires that 'RawSpan' conform to 'Escapable'

All CryptoKit types →