diff options
author | Mykola Nikishov | 2016-04-21 19:59:26 +0000 |
---|---|---|
committer | Mykola Nikishov | 2019-07-08 17:47:43 +0000 |
commit | 568ec2758ef480b7a69dc8572bf80fa8f1b281b2 (patch) | |
tree | 60b685ade900b9b5463fc7710d9362e1e4dab6c2 /bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository | |
parent | 2bcad99a06945190c7baff4268f9fc459bc34dfd (diff) | |
download | rt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.tar.gz rt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.tar.xz rt.equinox.p2-568ec2758ef480b7a69dc8572bf80fa8f1b281b2.zip |
Bug 541781 - Support dynamically registered MessageDigest implementationsY20190715-2335Y20190715-0900I20190715-1800I20190714-1800I20190713-1800I20190713-1105I20190713-0230I20190712-1800
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.repository/src/org/eclipse/equinox/internal/p2/artifact/repository')
2 files changed, 4 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java index 9208be003..f4eba31a3 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java @@ -70,6 +70,7 @@ public class Messages extends NLS { public static String calculateChecksum_file; public static String calculateChecksum_ok; public static String calculateChecksum_error; + public static String calculateChecksum_providerError; static { // initialize resource bundles diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties index 2efde4def..fa54c3f8c 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties @@ -55,8 +55,9 @@ exception_unsupportedGetOutputStream=Cannot write artifacts to a composite repos exception_unsupportedRemoveFromComposite = Cannot remove descriptors from a composite repository. calculateChecksum_file=Calculating checksums for file {0}. -calculateChecksum_ok=Calculated checksum using id={0} algorithm={1}: {2}. -calculateChecksum_error=Error calculating checksum using id={0} algorithm={1}. +calculateChecksum_ok=Calculated checksum using id={0} algorithm={1} provider={2}: {3}. +calculateChecksum_error=Error calculating checksum using id={0} algorithm={1} provider={2}. +calculateChecksum_providerError=Checksum provider id={0} algorithm={1} provider={2} error. exception_unableToCreateParentDir = Unable to create parent directory. folder_artifact_not_file_repo=Artifact {0} is a folder but the repository is an archive or remote location. |