I am signing the data using self signed certificate as I observed that after signing the data, capturing the signature in a file, noticed the signature has been changing when ever data changes. this is a challenge to verify the data using this signature at destination.
The issue is how the verifier will verify the data using the changing signature every instance, would like to understand.
if data changes the signature will also change everytime?
Yes, a signature value must be recalculated every time the data changes. However, the public key used to verify the data stays the same. So as long you've got the data, a signature and the a corresponding, trusted, public key you can verify the data.
Usually a signature consists of a cryptographically secure one-way hash and two related asymmetric transforms which relies on a - hopefully - NP-hard problem. The one way hash is calculated over the message; it is impossible to find a second message that will produce the same hash value. Then this hash value is transformed into a signature using the private key, encoded as a number of bytes. Upon receiving the data the hash is recalculated, and a verification function is called using the calculated hash and signature value as input, and using the public key as input.
For, for instance, RSA (when using PKCS#1 padding) the verification function simply retrieves the one way hash function so the two can be compared. Obviously this will fail if the data is different. And it should, otherwise anybody with access to the data can change it without the signature becoming invalid. Other functions use the hash as input and may not directly compare the hash function.
If you want to incrementally update the signature you could take a look at a hash (or Merkle) tree. You can store the Merkle tree and only recalculate the hashes of the elements that have changed. You can also add or remove hashes from the tree. You must however still perform the private key operation on the resulting topmost hash.