Sign documents with encrypted QR-code text
Leave feedback
GroupDocs.Signatureย provides ability to secure QR-code signature text with standard or custom encryption. Standard encryption is implemented over classย SymmetricEncryptionย class. Creation of this object expects 3 arguments like encryption algorithm enumerationย SymmetricAlgorithmTypeย with one of following values (DES, TripleDES, RC2, Rijndael), string value key and string value salt.
Here are the steps to secure QR-code text with standard encryption with GroupDocs.Signature:
Create new instance ofย Signatureย ย class and pass source document path or stream as a constructor parameter.
Compose object ofย SymmetricEncryptionย classย with required algorithm and secure pair key/salt
This example shows how to sign document with secure QR-code signature text.
using(Signaturesignature=newSignature("sample.pdf")){// setup key and passphrasestringkey="1234567890";stringsalt="1234567890";// create data encryptionIDataEncryptionencryption=newSymmetricEncryption(SymmetricAlgorithmType.Rijndael,key,salt);// setup QR-Code optionsQrCodeSignOptionsoptions=newQrCodeSignOptions(){//setup text to be securedText="This is private text to be secured.",EncodeType=QrCodeTypes.QR,// specify text encryptionDataEncryption=encryption,// locate and aligh signatureHeight=100,Width=100,VerticalAlignment=VerticalAlignment.Bottom,HorizontalAlignment=HorizontalAlignment.Right,Margin=newPadding(){Right=10,Bottom=10}};// sign document to filesignature.Sign("QRCodeEncryptedText.pdf",options);}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourย GitHub examples: