Discuss this help topic in SecureBlackbox Forum

XML: Verify signature with MAC key

To validate a signature using HMAC key you need to create an instance of TElXMLKeyInfoHMACData class then set HMAC key to TElXMLKeyInfoHMACData.Key property, and then assign this TElXMLKeyInfoHMACData object to TElXMLVerifier.HMACKey property.

C#:


TElXMLKeyInfoHMACData HMACKeyData = new TElXMLKeyInfoHMACData(true);
HMACKeyData.Key.Key = HMACKey; // set a buffer with HMAC key
Verifier.HMACKey = HMACKeyData;
Delphi:

HMACKeyData := TElXMLKeyInfoHMACData.Create(true);
HMACKeyData.Key.Key := HMACKey; // set a buffer with HMAC key
Verifier.HMACKey := HMACKeyData;
...
// after validation, we need to clear the key object
HMACKeyData.Free;

How To articles about XML signing (XMLDSig and XAdES)

Discuss this help topic in SecureBlackbox Forum