Confused with public keys

1,015 views
Skip to first unread message

Ziyuan Yao

unread,
Apr 27, 2012, 4:54:12 PM4/27/12
to Chromium-extensions
In the Chrome profile that develops my extension, the Extension
Manager says the unpacked extension's ID is
ipfammnpnfdipnoghpmcdkicpijdidhb.

Then I packed the unpacked extension to a .crx file. I installed
that .crx file in a new Chrome profile, and the new profile's
Extension Manager says the installed extension's ID is
oohplmnpniglbaibglmnikgkkoanpino.

I'm confused. Which ID should I use in an autoupdate xml file?

Also, it seems, whichever ID I use, the autoupdate doesn't work.

Ziyuan Yao

unread,
Apr 27, 2012, 4:58:55 PM4/27/12
to Chromium-extensions
I suppose I should use the packed .crx's extension ID in update.xml.

I also wonder where Chrome store an extension's public key or ID so
that the next time it packs an updated version of the same extension
it will know the public key and write it to the new .crx file?

Ziyuan Yao

unread,
Apr 27, 2012, 5:14:04 PM4/27/12
to Chromium-extensions
OK, it works now!

Abraham Williams

unread,
Apr 27, 2012, 5:22:12 PM4/27/12
to Ziyuan Yao, Chromium-extensions
The ID of an extension is based on the pem key generated when you pack an extension. When you pack later versions of the extension the key file will make sure the crx file will have the same ID and that existing installs can be updated using it. That is the ID to use with autoupdate. The key is saved in the same directory as the crx file. It is your responsibility to keep the key safe unless you are using the Web Store.

Abraham
--
Abraham Williams | abrah.am | abraham+
@abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Ziyuan Yao

unread,
Apr 27, 2012, 5:25:20 PM4/27/12
to Chromium-extensions
Still I wonder how Chrome remembers public keys.

Suppose I have a folder /a/b/c/ where my unpacked extension is in;

The first time I use Chrome to pack this folder to a .crx, Chrome
generates:
/a/b/c.crx
/a/b/c.pem

And if I install this c.crx in a new Chrome profile, I can see its
extension ID=xxx.

Now if I copy /a/b/c/ and c.pem to another developer machine and use
that new machine's Chrome to pack the new machine's /a/b/c/ and c.pem
to a .crx, how does the new machine's Chrome know the generated .crx's
extension ID should still be xxx?

Ziyuan Yao

unread,
Apr 27, 2012, 5:27:50 PM4/27/12
to Chromium-extensions
Ah, based on the pem key (private key), not the public key!

So I was misinformed by http://code.google.com/chrome/extensions/autoupdate.html
which says:

"The extension ID, generated based on a hash of the extension's public
key"

Google, please correct that page...

On Apr 28, 5:22 am, Abraham Williams <4bra...@gmail.com> wrote:
> The ID of an extension is based on the pem key generated when you pack an
> extension. When you pack later versions of the extension the key file will
> make sure the crx file will have the same ID and that existing installs can
> be updated using it. That is the ID to use with autoupdate. The key is
> saved in the same directory as the crx file. It is your responsibility to
> keep the key safe unless you are using the Web Store.
>
> Abraham
> --
> Abraham Williams | abrah.am |
> abraham<https://plus.google.com/114233674199568482864>
> +
> @abraham <https://twitter.com/intent/follow?screen_name=abraham> |
> github.com/abraham | blog.abrah.am
> This email is: [ ] shareable [x] ask first [ ] private.
>
>
>
>
>
>
>
> On Fri, Apr 27, 2012 at 13:58, Ziyuan Yao <yaoziy...@gmail.com> wrote:
> > I suppose I should use the packed .crx's extension ID in update.xml.
>
> > I also wonder where Chrome store an extension's public key or ID so
> > that the next time it packs an updated version of the same extension
> > it will know the public key and write it to the new .crx file?
>
> > On Apr 28, 4:54 am, Ziyuan Yao <yaoziy...@gmail.com> wrote:
> > > In the Chrome profile that develops my extension, the Extension
> > > Manager says the unpacked extension's ID is
> > > ipfammnpnfdipnoghpmcdkicpijdidhb.
>
> > > Then I packed the unpacked extension to a .crx file. I installed
> > > that .crx file in a new Chrome profile, and the new profile's
> > > Extension Manager says the installed extension's ID is
> > > oohplmnpniglbaibglmnikgkkoanpino.
>
> > > I'm confused. Which ID should I use in an autoupdate xml file?
>
> > > Also, it seems, whichever ID I use, the autoupdate doesn't work.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org.
Reply all
Reply to author
Forward
0 new messages