Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CCHMacMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Encryption and Hash MBS MacOSX Plugin 11.3 Yes No No Yes, macOS only No
Function: Keyed Message Authentication Code (HMAC) functions.
dim h as new CCHMacMBS(CCHMacMBS.kCCHmacAlgSHA1, "Hello")
h.Update "Hello World!"
dim m as MemoryBlock = h.Finalize
MsgBox EncodingToHexMBS(m)
Notes: This class uses the CommonCrypto interface which is available on Mac OS X 10.5 or newer and also on iOS. So you can use it to get the same results on both operation systems. Also as you simply use Apple provided encryption, you don't need to apply for an export license for this classes here.

Feedback, Comments & Corrections

Algorithms Constants

Constant Value Description
kCCHmacAlgMD5 1
kCCHmacAlgSHA1 0
kCCHmacAlgSHA224 5
kCCHmacAlgSHA256 2
kCCHmacAlgSHA384 3
kCCHmacAlgSHA512 4

Digest Length Constants

Constant Value Description
kCCMD5DigestLength 16
kCCSHA1DigestLength 20

This class has no sub classes.

Some examples which use this class:

The items on this page are in the following plugins: MBS MacOSX Plugin.

CCCryptorMBS   -   CCMD2MBS

MBS Xojo PDF Plugins