Search for encrypted text in Metadata signatures
Leave feedback
GroupDocs.Signature provides ability to search encrypted Metadata signatures 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 search for encrypted Metadata signature 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 same parameters as secured QR-code was signed with.
This example shows how to search for secure Metadata signature text.
Signaturesignature=newSignature("MetadataEncryptedText.docx");// setup key and passphrase
Stringkey="1234567890";Stringsalt="1234567890";// create data encryption
IDataEncryptionencryption=newSymmetricEncryption(SymmetricAlgorithmType.Rijndael,key,salt);MetadataSearchOptionsoptions=newMetadataSearchOptions();options.setDataEncryption(encryption);// search for signatures in document
List<WordProcessingMetadataSignature>signatures=signature.search(WordProcessingMetadataSignature.class,options);System.out.print("\nSource document contains following signatures.");// get required metadata signatures
WordProcessingMetadataSignaturemdAuthor=null;for(WordProcessingMetadataSignaturemdSign:signatures){if(mdSign.getName().equals("Author")){mdAuthor=mdSign;break;}}if(mdAuthor!=null){System.out.print("Metadata signature found. Name : "+mdAuthor.getName()+". Value: "+mdAuthor.getData(String.class));}// get required metadata signatures
WordProcessingMetadataSignaturemdDocId=null;for(WordProcessingMetadataSignaturemdSign:signatures){if(mdSign.getName().equals("DocumentId")){mdDocId=mdSign;break;}}if(mdDocId!=null){System.out.print("Metadata signature found. Name : "+mdDocId.getName()+". Value: "+mdDocId.getData(String.class));}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.