HMAC

public class HMAC : Updateable

Calculates a cryptographic Hash-Based Message Authentication Code (HMAC).

  • Enumerates available algorithms.

    See more

    Declaration

    Swift

    public enum Algorithm
  • Status of the calculation

    Declaration

    Swift

    public var status : Status = .Success
  • Creates a new HMAC instance with the specified algorithm and key.

    Declaration

    Swift

    public init(algorithm : Algorithm, key : NSData)

    Parameters

    algorithm

    selects the algorithm

    key

    specifies the key

  • Creates a new HMAC instance with the specified algorithm and key.

    Declaration

    Swift

    public init(algorithm : Algorithm, key : [UInt8])

    Parameters

    algorithm

    selects the algorithm

    key

    specifies the key

  • Updates the calculation of the HMAC with the contents of a buffer.

    Declaration

    Swift

    public func update(buffer : UnsafePointer<Void>, _ byteCount : size_t) -> Self?

    Return Value

    the calculated HMAC

  • Finalizes the HMAC calculation

    Declaration

    Swift

    public func final() -> [UInt8]

    Return Value

    the calculated HMAC