Forum Discussion

cst99003's avatar
cst99003
Contributor
5 years ago

How do I get TC to recognize Certificates?

Hello,

 

I am trying to get TC to recognize Certificates for SSL.  I have a JKS file but I also have the 3 CER files that exist in the JKS file.

 

What I am curious to know is....

- What is the path I need to add the CER file so that TC can recognize them?

- Do I need to use the code below to get TC to pull them in?

- Can I set something in the Preferences to find the path of the CERT's?

- Is there a better or different format to put the cert's in, other than .cer?

 

Suggestions or Comments?

 

function CertificateInfoSample()

{

var fileName = Sys.Process("iexplore").Path; // Specify the file name here

//var fileName = Sys.Process("TestComplete").Path; // Specify the file name here

//var fileName = "C:\\AuthKey_ADB\\clientcert.jks"; // Specify the file name here

var certInfo = aqFileSystem.GetFileInfo(fileName).CertificateInfo; 

Log.Message("Version: " + certInfo.Version);

Log.Message("Serial number: " + certInfo.SerialNumber);

Log.Message("Signature algorithm: " + certInfo.Algorithm);

Log.Message("Issuer: " + certInfo.Issuer);

Log.Message("Valid from: " + aqConvert.DateTimeToFormatStr(certInfo.NotBefore, "%#c"));

Log.Message("Valid to: " + aqConvert.DateTimeToFormatStr(certInfo.NotAfter, "%#c"));

Log.Message("Subject: " + certInfo.Subject);

Log.Message("Public key: " + certInfo.PublicKey);

}

 

 

 

 

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    It's been a while since I've done this but I believe you need to open Internet Explorer, go to Internet Options, and add the certificates into the Trusted Certifciate Authority there.  That SHOULD work.

      • cst99003's avatar
        cst99003
        Contributor

        Hello TanyaYatskovska ,

         

        i have asked a few questions on this topic and the solution that have been proposed appear to be reasonable and things that I had already tried.  It was nice to have confirmation that what I was doing was correct.

         

        But....  None of the solutuons at this time have resolved my issue.   I may need to get the certs moved into the correct location through Admin Privileges.

         

         

        Thank you

         

        Andrew

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    > I have a JKS file but I also have the 3 CER files that exist in the JKS file.

    According to my knowledge...

    .JKS is a Java container file that stores .cer certificates within it.

    As a file, .jks file can be located anywhere on the hard drive.

    Jave provides API to work with .jks and .cer files.

    .CertificateInfo() method returns information about certificate embedded into an executable (.exe or .dll) that was used to sign this executable.