6

鉴于以下情况HashedAuthenticationCode

import CryptoKit
let key = SymmetricKey(size: .bits256)
let message = "Hello world!".data(using: .utf8)!
let authenticationCode = HMAC<SHA256>.authenticationCode(for: message, using: key)
print(authenticationCode) // "HMAC with SHA256: c818a1400a9995d5faafbb5d41cc88a6701b5d1a4ded8ac169498319a2597e2a"

我如何访问该c818a1400a9995d5faafbb5d41cc88a6701b5d1a4ded8ac169498319a2597e2a值?最终,这必须通过 a 进行编码和序列化URLSession,但我看不到获取 HAC 的“代码”部分的明显属性!

4

0 回答 0