public init(key as String, keyEncoding as String = "utf8") as Void:
Loads the secret key used to compute the MAC.
| Parameter | Description |
|---|---|
key | Secret key material. |
keyEncoding | Key encoding: utf8, hex, base64 or base64url. |
import klyn.cryptography
mac = Hmac(SHA256())
mac.init("secret")