The principle of digital signature (electronic signature) can be explained in detail by referring to the article "Digital signature: combining public key and hash algorithm" in/basic/aboutpki.htm.
The sender applies a hash algorithm to the data and generates a hash value (data digest).
The sender uses the private key to convert the hash value (data digest) into a digital signature (that is, encrypt and sign the digest).
Then, the sender sends the data, signature and sender's certificate to the receiver. "