parse

suspend fun SigningAlgorithm.MACBased.parse(key: ByteArray, keyId: String? = null, format: HMAC.Key.Format = HMAC.Key.Format.RAW, cryptographyProvider: CryptographyProvider = CryptographyProvider.Default): SigningKey.SigningKeyPair(source)

Decodes an existing HMAC key from a ByteArray for use with this algorithm.

The returned SigningKey is a SigningKey.SigningKeyPair usable for both signing and verification since HMAC uses a single symmetric key.

Return

a SigningKey wrapping the decoded HMAC.Key.

Parameters

key

the raw key material to decode.

keyId

optional key ID to associate with the decoded key. Defaults to null.

format

the format in which key is encoded. Defaults to HMAC.Key.Format.RAW.

cryptographyProvider

the provider used to perform key decoding.