|
|||||||||
Netscape Code Signing -- Specifically Signing an XPI file
THIS FILE IS OUT OF DATE. I never finished writing this tutorial. It's half my own notes and half tutorial.
You need:
Now is the tricky part. Installing these bad boys. When unzipped inside their respective folders you will find three sub-directories. bin , includes, and lib. To make them run from anywhere you need to copy the contents of both bin and lib folders to C:\WINDOWS (C:\WINNT) or C:\WINDOWS\SYSTEM32 . This way you can run the signtool.exe from anywhere in the command line. You may also if you want, just copy the files in the NSPR lib directory into the NSS lib directory and just command line into the bin folder for NSS (that's what I did when I first started experimenting).
Now you can run the signtool.exe in command line. Now we need to get our Certificate Database path. Basically search your computer for cert8.db . They are saved in your profile folder for your browser.
Mozilla are in C:\Documents and Settings\<Windows Username>\Application Data\Mozilla\Profiles\<Profile Name>\<Weird Characters.something>\
FireFox they are in C:\Documents and Settings\<Windows Username>\Application Data\Mozilla\Firefox\Profiles\<Profile Name.something>\
I for the sake of convenience just copy the file cert7.db, cert8.db and secmod.db to the code signing directory. It's alot easier to put in
Now that we have our databases located we can start signing. There are a few ways you can do this. You can sign and create a .jar file with something like this
Since we are concentrating on XPI files it gets even more fun.
We have a directory called c:\codesigning\firefox_extension\ . This directory contains all the code for the extension we wish to sign. It should look something like
firefox_extension\ install.js extenstionfolder content\ contents.rdf files.xul files.js skin\ contents.rdf files.css locale\ contents.rdf extension.dtd
I normally create a .jar file of the main extension code folder so I just have two files in the XPI file. the install.js and the extension.jar. Which you can create using the signtool.
When installing an XPI file Mozilla based applications look for the first file in the .xpi to be the META-INF/zigbert.rsa file. This file is generated when signing files. So we must create the XPI file in parts .
Part 1. Sign the files.
From the command prompt in the codesigning directory we run the signtool without the .jar file creation.
Part 2. Create the .xpi file starting with META-INF/zigbert.rsa .
Part 3. Copy the rest of the signed files into the XPI file.
Part 4: We move the created .xpi and test it out.
If you don't get any errors throughout all of this you are lucky and followed the directions. If you did then just look back through the directions. This is everything I learned to get it right. Now all you have to do is drag and drop the XPI file over mozilla or FireFox and it should be flagged as signed.
Hosting sponsored by Dreamhost
| Best Viewed at 800x600 or higher. Using Mozilla or FireFox |
© J-Maxx Net 1999-2008 |