Authenticate Method
Authenticate(Byte[])
Returns the result of computing HMAC-SHA-256 on the given message using the AuthenticationKey. With protocol 1, the result is the first 16 bytes of the HMAC, and with protocol 2 it is the entire 32-byte result.
public abstract byte[] Authenticate(byte[] message)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | message | The data to be authenticated. |
Returns
A new byte array containing the authentication result.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.InvalidOperationException | The object has been created or initialized, but the Encapsulate(CoseKey) method has not been called. |
Authenticate(Byte[], Byte[])
Returns the result of computing HMAC-SHA-256 on the given message
using the provided keyData
. With protocol 1, the result is the
first 16 bytes of the HMAC, and with protocol 2 it is the entire
32-byte result.
protected abstract byte[] Authenticate(byte[] keyData, byte[] message)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | keyData | The key to use to authenticate. |
System.Byte[] | message | The data to be authenticated. |
Returns
A new byte array containing the authentication result.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |