Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMykola Nikishov2016-04-21 15:59:26 -0400
committerMykola Nikishov2019-07-08 13:47:43 -0400
commit568ec2758ef480b7a69dc8572bf80fa8f1b281b2 (patch)
tree60b685ade900b9b5463fc7710d9362e1e4dab6c2 /bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle
parent2bcad99a06945190c7baff4268f9fc459bc34dfd (diff)
downloadrt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.tar.gz
rt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.tar.xz
rt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.zip
Extend o.e.e.p2.artifact.repository.artifactChecksums extension point with attribute providerName to support custom MessageDigest implementations as per Java Security API. To get an instance of custom MessageDigest in ChecksumProducer's getMessageDigest(String, String), look for service object under java.security.Provider interface filtered by providerName property and pass it to java.security.MessageDigest's getInstance(String, Provider). Throws NoSuchProviderException if no such service was found. Bundle that contributes such implementation should register it with the Framework service registry under interface java.security.Provider. The registration properties of the service should contain property 'providerName' with value of type String as returned by implementation's java.security.Provider.getName(). The same value should be used for providerName attribute in artifactChecksums extension point. o.e.equinox.p2.artifact.checksums.bouncycastle bundle demonstrates how this works by adding support for Whirlpool and DSTU7564 message digests using the Bouncy Castle Crypto APIs [1]. It is not part of the distribution and used by unit tests only. [1] https://bouncycastle.org/ Change-Id: I0cfd06ceca6e1911d69bab09331399500a00dcee Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.classpath7
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.gitignore1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.project39
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/META-INF/MANIFEST.MF12
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/OSGi-INF/securityProvider.xml8
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/about.html36
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/build.properties20
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.properties15
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.xml18
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/pom.xml17
10 files changed, 173 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.classpath b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.classpath
new file mode 100644
index 000000000..4f83b2397
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.gitignore b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.gitignore
new file mode 100644
index 000000000..c5e82d745
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.gitignore
@@ -0,0 +1 @@
+bin \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.project b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.project
new file mode 100644
index 000000000..9ef20c163
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.p2.artifact.checksums.bouncycastle</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..28688b977
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.equinox.p2.artifact.checksums.bouncycastle;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.equinox.p2.artifact.repository;bundle-version="[1.3.200,2.0.0)"
+Import-Package: org.bouncycastle.jce.provider;version="[1.59.0,2.0.0)"
+Service-Component: OSGi-INF/securityProvider.xml
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/OSGi-INF/securityProvider.xml b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/OSGi-INF/securityProvider.xml
new file mode 100644
index 000000000..a9e7e8c00
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/OSGi-INF/securityProvider.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.equinox.p2.artifact.checksums.bouncycastle">
+ <implementation class="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
+ <service>
+ <provide interface="java.security.Provider"/>
+ </service>
+ <property name="providerName" type="String" value="BC"/>
+</scr:component>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/about.html b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/about.html
new file mode 100644
index 000000000..164f781a8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/about.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>About</title>
+</head>
+<body lang="EN-US">
+ <h2>About This Content</h2>
+
+ <p>November 30, 2017</p>
+ <h3>License</h3>
+
+ <p>
+ The Eclipse Foundation makes available all content in this plug-in
+ (&quot;Content&quot;). Unless otherwise indicated below, the Content
+ is provided to you under the terms and conditions of the Eclipse
+ Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
+ available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.
+ </p>
+
+ <p>
+ If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ (&quot;Redistributor&quot;) and different terms and conditions may
+ apply to your use of any object code in the Content. Check the
+ Redistributor's license that was provided with the Content. If no such
+ license exists, contact the Redistributor. Unless otherwise indicated
+ below, the terms and conditions of the EPL still apply to any source
+ code in the Content and such source code may be obtained at <a
+ href="http://www.eclipse.org/">http://www.eclipse.org</a>.
+ </p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/build.properties b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/build.properties
new file mode 100644
index 000000000..e39635637
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2016, 2019 Mykola Nikishov.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Mykola Nikishov - initial API and implementation
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ OSGi-INF/securityProvider.xml
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.properties b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.properties
new file mode 100644
index 000000000..03086091d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2016, 2019 Mykola Nikishov.
+#
+# This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License 2.0
+# which accompanies this distribution, and is available at
+# https://www.eclipse.org/legal/epl-2.0/
+#
+# SPDX-License-Identifier: EPL-2.0
+#
+# Contributors:
+# Mykola Nikishov - initial API and implementation
+###############################################################################
+pluginName = Equinox p2 Artifact Checksum Support
+providerName = Eclipse.org - Equinox
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.xml b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.xml
new file mode 100644
index 000000000..8d00dbfcd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/plugin.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums">
+ <artifactChecksum
+ algorithm="Whirlpool"
+ id="whirlpool"
+ providerName="BC">
+ </artifactChecksum>
+ </extension>
+ <extension point="org.eclipse.equinox.p2.artifact.repository.artifactChecksums">
+ <artifactChecksum
+ algorithm="DSTU7564-512"
+ id="dstu7564-512"
+ providerName="BC">
+ </artifactChecksum>
+ </extension>
+</plugin>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/pom.xml b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/pom.xml
new file mode 100644
index 000000000..78d0946a3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.checksums.bouncycastle/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.eclipse.equinox.p2</groupId>
+ <artifactId>rt.equinox.p2</artifactId>
+ <version>4.13.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>org.eclipse.equinox.p2.artifact.checksums.bouncycastle</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <properties>
+ <skipAPIAnalysis>true</skipAPIAnalysis>
+ </properties>
+</project>

Back to the top