MAC/Hash-related Calls
This section describes the MAC-related class, NaeHmacKey. This class implements the HMAC algorithm. It extends System.Security.Cryptography.HMAC
and CADP.NetCore.Crypto.INaeKey
.
Constructors
Constructor | Description |
---|---|
NaeHmacKey(NaeSession naeSession, HmacAlgo algo, string keyName) | Creates a new instance of an NaeHmacKey of type HmacAlgo. |
NaeHmacKey(NaeSession naeSession, HmacAlgo algo) | Creates a new key object with no key bytes. This key can then be created on the CipherTrust Manager using GenerateKey(). |
Properties
Properties | Description |
---|---|
string CryptoAlgName | (read) Name of the Cryptographic algorithm to which the key belongs to. |
string KeyName | (read) Key name. |
bool IsDeletable | (read & write) True if the key can be deleted. Can only be set if the key does not exist on the CipherTrust Manager. |
bool IsExportable | (read & write) True if the key can be exported. Can only be set if the key does not exist on the NAE Server. |
byte[] Hash | Returns the computed hash value. |
Methods
Method | Description |
---|---|
void GenerateKey(string KeyName) | Creates a new key on the CipherTrust Manager. |
byte[] GenerateMac(byte[] inputData) | Generates MAC of the specified input bytes. |
bool VerifyMac(byte[] inputData, byte[] mac) | Verifies the input data with the MAC generated. |
byte[] ComputeHash(byte []inputData) | Computes hash of the specified input bytes. |
Note
The method ComputeHash
and property Hash
are used for large data size.