sign-p2-artifacts does not PGP sign features
Hi,
I am trying to sign a p2 with tycho-gpg-plugin:sign-p2-artifacts (I tried 2.73 and 3.0.4)
It is only signing the plugins, not the features.
The plugin are artifacts with classifier osgi.bundle in artifacts.xml and are properly updated with gpg properties The features are artifacts with classifier org.eclipse.update.feature and are not updated with gpg properties
Maven logs show nothing interesting.
What can I do to understand why the features are not signed ?
Thanks
Can you provide an integration-test to demonstrate the issue? I'm not sure if signing of features is actually supported (@merks ?) in the P2 UI but technically it would be possible of course, I just think there is no test for this at the moment.
Feature jars are “normally” jar-signed. I’ve never tried to pgp sign such things. It’s not something an Eclipse project would ever seem to need. But it nevertheless ought to be supported. A test case will be needed for sure.
You say 'Feature jars are “normally” jar-signed'. Do you have a link to how to sign a p2 (allowing the Trust dialog to display to the user that everything is signed) ?
Eclipse projects use this:
https://www.eclipse.org/cbi/sitedocs/eclipse-jarsigner-plugin/sign-mojo.html
But if you're not an Eclipse-hosted project, that's not very helpful advice.
I'm not sure how to use this one:
https://maven.apache.org/plugins/maven-jarsigner-plugin/
I would expect this to work on features:
https://tycho.eclipseprojects.io/doc/latest/tycho-gpg-plugin/sign-p2-artifacts-mojo.html
If that doesn't work, I'd expect it to be relatively straight-forward to fix it...
We are trying to move the Spring Tools to GPG signing as well and stumbled upon this as well, so the regular bundles gets GPG signed, but not the features. Unless we sign then the "regular jar signing way", they show up as unsigned in the install dialog.
While the solution was designed ignoring features (the story was to be able to consume 3rd-party bundles directly and get them signed without altering them), the mojo could most likely be improved to also read and sign feature artifacts. A PR to add that support would be very welcome.
@martinlippert can you describe how you proceed to make the unsigned warning disappear ? (do you modify the artifacts.xml file ?) Thanks
I have tried to jarsign the feature jar file to no avail. I have tried to gpg sign the feature jar file too (including updating artifacts.xml to add the properties pgp.signatures and pgp.publicKeys)
(By the way how is it that the properties are called pgp and not gpg ?)
If signing of features with PGP means only adding:
<property name='pgp.publicKeys' value='MY-PGP-KEY'/>
under the proper artifact descriptor for a feature (i.e. classifier='org.eclipse.update.feature') then I think it is working... Or is there more than just artifacts.xml file?
@BoykoAlex The page https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_pgp.html should tell it all.
(By the way how is it that the properties are called pgp and not gpg ?)
PGP is the cryptography strategy, gpg is one implementation, which we're not even using in Eclipse p2.
If an artifact has been PGP signed, its artifact metadata will have both pgp.signatures and pgp.publicKeys properties like this one:
<artifact classifier='osgi.bundle' id='slf4j.api.source' version='2.0.7'> <properties size='13'> <property name='maven-groupId' value='org.slf4j'/> <property name='maven-artifactId' value='slf4j-api'/> <property name='maven-version' value='2.0.7'/> <property name='maven-classifier' value='sources'/> <property name='maven-repository' value='eclipse.maven.central.mirror'/> <property name='maven-type' value='jar'/> <property name='download.size' value='72932'/> <property name='artifact.size' value='72932'/> <property name='download.checksum.sha-512' value='0bf2f5807dedcc81b23c9dcd341c59e81339a1ef898f39a257b76c8a0ebdf7f4e94b8fda6e5c4c1e5981843a922a712b6f113b74435fc10485d7943d41d62563'/> <property name='download.checksum.sha-1' value='a017c6fd9ea69485bb22198ec8d5dd3d5805d467'/> <property name='download.checksum.sha-256' value='e75c0f77298ceaa7a5be9a43b5cc3af27067c0ce39c8c048cde2f50d0efd839b'/> <property name='pgp.signatures' value='-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEER3fdMHEepq82fzR46zw49seg8A0FAmSYT1wACgkQ6zw49seg
8A2t4w//aYQaYboWjpW1LD+UqSDTV3OkUJFgMPq6o8sIhkCAz4xMuQJz2zTj3jL9
edK/Bh6ISSBMS3w5qoyex/9L0qvYpSdooE81zI1a+D3aQH9444VgmVO2S3IjzDBs
x4e9pE6KLAFw/YV3Diz0IAebofBQeOqj/65lDXxYT3Z6a3e884FXTQa5eEW3WgbV
zKMbQPblJgAzow2asAwZeC+wUzMXfDye7lakul43kUyV3QUvuT79PFCtlyKO2dee
tmB6Ur33U9DpdJPBcQ9YlDgIBuwH7l5Ov9Gl6sWojDxjIx2qS//rL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