This guide is a short tutorial on how to create a 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 .
Let's review the Digital Signature creation process:
- Developers need to initialize the
VSSVirgilApi *virgil = [[VSSVirgilApi alloc]
- Load Alice's Virgil Key from the protected storage and enter the Virgil Key's password;
// load Virgil Key
VSSVirgilKey *aliceKey = [virgil.keys loadKeyWithName:@"[KEY_NAME]"
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
NSString *message = @"Hey Bob, hope you are doing well.";
// generate signature
NSData *signature = [aliceKey generateSignatureForString:message error:nil];
Alice can now send a signed message to Bob.
Developers also can sign data using the Virgil CLI. More details are available here.