This guide is a short tutorial on how to create a Digital SignatureA Digital Signature can be used with any kind of message, so the receiver can be sure of the sender's identity and that the message arrived intact more ... with Virgil Security. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, that the sender cannot deny having sent the message, and that the message was not altered in transit. It can be used with any kind of message - whether it is encrypted or not.
See our Use Cases to find out what you can do with Digital Signature.
Set up your project environment before starting to create a Digital Signature, with the getting started guide.
The Signature Creation procedure is shown in the figure below.
In order to create a Digital Signature and sign the message, Alice has to have her Virgil KeyThe Virgil Key is a wrapper of the user's secure Private Key more ....
Let's review the Digital Signature creation process:
- Developers need to initialize the Virgil SDKThe SDK helps take tedious complexity out of coding by providing APIs for all of Virgil Services.
virgil = Virgil("[YOUR_ACCESS_TOKEN_HERE]")
- Load Alice's Virgil Key from the protected storage and enter the Virgil Key's password;
# load Virgil Key
alice_key = virgil.keys.load("[KEY_NAME]", "[KEY _PASSWORD]")
To load the Virgil Key from a specific storage, developers need to change the storage path during Virgil SDK initialization.
Then Alice has to:
- Prepare the information for the message to Bob
- Sign the message using her Virgil Key
# prepare a message
message = "Hey Bob, hope you are doing well."
# wrap data to buffer
data_buff = VirgilBuffer.from_string(message)
# generate signature
signature = alice_key.sign(data_buff)
Alice can now send a signed message to Bob.
Developers also can sign data using the Virgil CLI. More details are available here.