0

i have HTML file which is password protected and i am signing using (chilkat) that is third party tool. the problem is that it neither get sign nor giving me any error. how i will identify in my code that file require password

here is my code

           if (!pcSourceFile.EndsWith(".pdf"))
            {
                byte[] lcReadByte = null;
                pSerialNumber = locertTest.SerialNumber;
                Issuer = locertTest.IssuerCN;
                SignTime = DateTime.Now;
                loCryptoTest.SetSigningCert(locertTest);
                byte[] lcWriteBytes = null;
                lcReadByte = loCryptoTest.ReadFile(pcSourceFile);
                //lcWriteBytes = loCryptoTest.OpaqueSignBytes(lcReadByte);
                lcWriteBytes = loCryptoTest.OpaqueSignBytes(lcReadByte);

                if (lcWriteBytes.Length == 0)
                {

   GlobalStatic.WriteLog(loCryptoTest.LastErrorText, "Opeque Sig nature Error", "Signature");
                    return false;
                }

                loCryptoTest.WriteFile(pcDestFile, lcWriteBytes);
                lcReadByte = null;
                lcWriteBytes = null;

            }
  • HTML or PDF? What's `loCryptoTest` - a chilkat object? You'll probably have to ask their support for an API to test if the PDF is password protected, and a explanation why their object isn't working. – Rup Sep 22 '14 at 10:06
  • Chilkat.Crypt2 loCryptoTest; html file – shoeb ahmad Sep 22 '14 at 10:10
  • i have HTML file if its password protected how i will come to know in C# – shoeb ahmad Sep 22 '14 at 10:14
  • I still don't understand sorry. There's no such thing as a password-protected HTML file I don't think - at least no standard built into HTML, unless it's really XHTML and you're using one of the XML encryption formats? - and your code sample says `.EndsWith(".pdf")` which is confusing me. Unless you mean you're reading the source over HTTP from a web page that is give you an authorisation error in response? Is that read happening in Chilkat code? It still sounds to me like you'll need to talk to them. – Rup Sep 22 '14 at 10:20
  • its ok thank you so much for your time to reply me i will go with your suggestion , that i will talk to support team of chilkat – shoeb ahmad Sep 22 '14 at 13:14

0 Answers0