diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd index 8c2a30612..0f7b4b097 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd @@ -69,6 +69,13 @@ As other tools will rely on this id, consider using some well-defined value (i.e </documentation> </annotation> </attribute> + <attribute name="providerName" type="string"> + <annotation> + <documentation> + For custom security provider, name of the security provider that provides this message digest implementation, the value returned by <code>java.security.Provider.getName()</code>. + </documentation> + </annotation> + </attribute> </complexType> </element> @@ -97,18 +104,35 @@ As other tools will rely on this id, consider using some well-defined value (i.e </extension> </pre> -If the MessageDigest implementation is provided by a custom Provider (from the contributing bundle itself or some other bundle), it should be first dynamically registered: +If the MessageDigest implementation is provided by a custom security provider (from the contributing bundle itself or some other bundle), it should be registered first with the Framework service registry under interface <code>java.security.Provider</code>: <pre> -import java.security.Security; +import java.security.Provider; +import java.util.Dictionary; +import java.util.Hashtable; + import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +... -public class Activator implements BundleActivator { +Dictionary<String, Object> props = new Hashtable<>(); +props.put("providerName", "BC"); +ServiceRegistration<Provider> registration = context.registerService(Provider.class, new BouncyCastleProvider(), props); +</pre> + +and then register an extension using <code>providerName</code> attribute: - public void start(BundleContext context) throws Exception { - Security.addProvider(new BouncyCastleProvider()); - } -} +<pre> +<extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums"> + <artifactChecksum + algorithm="Whirlpool" + id="whirlpool" + providerName="BC"> + </artifactChecksum> +</extension> </pre> </documentation> </annotation> |