HMAC encryption in Swift 2 : <p>Java provides <a href="https://docs.oracle.com/javase/7/docs/api/javax/crypto/Mac.html" rel="nofollow">MAC(Message Authentication Code) algorithm API</a> with which I can encrypt <code>data</code> by: </p>

<pre><code>byte[] data = getDataBytes();
Mac mac = Mac.getInstance("HMAC-SHA256");
mac.init(new SecretKeySpec(key, "HMAC-SHA256"));
byte[] encryptedBytes = mac.doFinal(data);
</code></pre>

<p>I am new in Swift, how can I implement the same thing as above with Swift 2 ?</p>
