blob: d3726b77b20dc86f90e9e4236c8714b244b5a1a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
package jose
import (
"crypto/hmac"
"hash"
)
func calculateHmac(keySizeBits int, securedInput []byte, key []byte) []byte {
hasher := hmac.New(func() hash.Hash { return hashAlg(keySizeBits)}, key)
hasher.Write(securedInput)
return hasher.Sum(nil)
}
|