Ask a Question

Check files without certification information

Jin
New Contributor

Check files without certification information

if the file does not have Certification information, The returned aqFileCertificateInfo will be one with empty string value. Error will be occured when someone try to check property.

How can I know its a file without certification information before I try to do more checks?

 

7 REPLIES 7
Marsha_R
Community Hero

I would check to see if the variable used for the cert info is not empty.  If that is true, then do the rest of the checks.  

   


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Jin
New Contributor

But how... As I said... There will be one aqFileCertificateInfo Object (empty value) returned back... If I want to check its properties.. broken with error

Marsha_R
Community Hero

This uses the file in the example from here

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfileinfo/certificateinfo...

 

Marsha_R_0-1635871437428.pngMarsha_R_1-1635871470232.png

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Jin
New Contributor

Hi Marscha, 

Thanks for your feedback... however I know this Weblink and I have to highlighten one sentence in there 

 

.... If you try to call properties or methods on such a certificate from your tests, an error will occur.......

 

Means I got an "empty" CertInfo back in case of that the file does not have any digital signature. 

 

My question is how can I know its an "empty" CertInfo before I do any checks on its properties....

Marsha_R
Community Hero

What happened when you tried my example?  Show the log please.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Jin
New Contributor

I did similar things but using script: 

 

My code like 

var certinf0 = aqFileSystem.GetFielInfo(file).CertificateInfo; 

 

then I try to do some comparison like 

aqObject.CompareProperty(certinfo.Subject, cmpContains, "some signature", true, 0);

 

Error occured: 

Jin_0-1636445590989.png

 

 

Marsha_R
Community Hero

It would be helpful if you try the exact example that I gave you.  It is from the documentation and if it does not work for you then it gives us a path to follow.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: