Use if the sender of the XML document and the receiver share a common secret
key.
How to sign
- Create a HMAC key with the constructor of the CryptoKey class.
- Set or load the common shared key
value in the CryptoKey object.
- Create a blank signature with the constructor of the Signature
class.
- Assign the
CryptoKey object to the Signature object.
- Create one or more references to be signed.
- Compute the
signature.
- Retrieve
the XML signature document from the Signature object.
How to verify
- Create a HMAC key with the constructor of the CryptoKey.
- Set or load the common shared key
value in the CryptoKey object.
- Create a signature with the constructor
of the Signature class and from a XML signature node obtain after the above compute operation.
- Assign the
CryptoKey object to the Signature object.
- Verify the
signature validity.