Hello people, I'm arun....I am badly in need for a solution....
My requirement is to sign a file in PKCS#7 format, then encode it into base64 format and send the same to the server. I'm using Fireox 2.0.0.9 I very well know that "window.crypto.signText" cannot be used to sign file in binary format........and ofcourse I don't want to use that. I'm quite familiar with both javascript and C++ XPCOM and have used the following interfaces in C++ using the Gecko SDK to get my job done... nsICryptoHash - > for computing the hash nsICMSMessage -> for signing the hash (encrypting the hash with private key) nsICMSEncoder -> for encoding the same to PKCS#7 or CMS format My problem is that I'm getting the signature in an indefinite length encoded format and also only detached signature is available. Now my question is: 1. Is there anyway to get the raw PKCS#1 signature using C++ XPCOM? 2. In what format does the nsICMSMessage's "CreateSigned" function return the signature? Is it a raw signature computed on the hash or it also includes the PKCS#9 attributes? 3. How to capture the signature output from nsICMSMessage? I'm could only use it as an object and not able to capture any char buffer? 4. How to use these XPCOM interfaces to get a attached signature? 5. How to get the private key alone using XPCOM? If I could get the private key alone then it would solve my problem. But doing that with XPCOM seems to be difficult or even impossible. I also came across the NSS and PSM api's. Can these api's solve my problem? If at all NSS will be the only solution, I want some guidelines on using the same with C++ and not using Java. Where can I find information about downloading the NSS api and using it in C++? Also my C++ component is not getting registered with Netscape during startup....I doubt the Gecko SDK version that I'm using is not appropriate. I don't think I may need to change my C++ doe for netscape....What could be the problem Thanks in advance, Arun _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto