Using XML Digital Signatures
Signature generation (at the sender's end):
Identify the resources that need to be signed.
Apply transforms, if any to the resources.
Apply digesting algorithms over the resource, and calculate the digest value.
Repeat the above process for each resource that needs to be signed. Enclose the details in the <Reference> element.
Collect all <Reference> elements inside the <SignedInfo> element. Indicate the canonicalization and signature methodologies.
Canonicalize contents of <SignedInfo>, apply the signature algorithm, and generate the XML Digital signature.
Enclose the signature within the <SignatureValue> element.
Add relevant key information, if any, and produce the <Signature> element.
Transmit the signature to the receiver.
Signature verification (at the receiver's end):
Verify the signature contained in the <SignatureValue> element. Do this by calculating the digest of <SignedInfo> element, and apply the signature algorithm with the public key of the sender. This process can identify whether the signature is valid or not.
If this process is successful, apply the digest algorithms to required resources, and recalculate the digest of the same. Compare these digest values with those inside the corresponding <Reference> tags.