Debian Codegraph @

bundles/org.eclipse.equinox.p2.artifact.repository/schema/artifactChecksums.exsd

raw
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- Schema file written by PDE -->
3 <schema targetNamespace="org.eclipse.equinox.p2.artifact.repository" xmlns="http://www.w3.org/2001/XMLSchema">
4 <annotation>
5 <appInfo>
6 <meta.schema plugin="org.eclipse.equinox.p2.artifact.repository" id="artifactChecksums" name="Artifact Checksum support"/>
7 </appInfo>
8 <documentation>
9 Provides a mapping from checksum algorithm id and &lt;code&gt;java.security.MessageDigest&lt;/code&gt; implementations.
10
11 &lt;p&gt;p2 detects errors which may have been introduced during artifact transmission/storage by calculating artifact checksum using MD5 hash function. As a &lt;a href=&quot;https://en.wikipedia.org/wiki/Collision_attack&quot;&gt;collision attack&lt;/a&gt; and a &lt;a href=&quot;https://en.wikipedia.org/wiki/Chosen-prefix_collision_attack&quot;&gt;chosen-prefix collision attack&lt;/a&gt; against MD5 have been demonstrated in public, it can be used but only to detect unintentional corruption. Current implementation is not extensible and doesn&apos;t allow to use other, more collision-resistant, hash functions.&lt;/p&gt;
12
13 &lt;p&gt;With this extension point, any &lt;code&gt;java.security.MessageDigest&lt;/code&gt; from Java Security API can be used to check integrity of artifacts. For more information on these APIs, see &lt;a href=&quot;https://docs.oracle.com/en/java/javase/11/security/java-cryptography-architecture-jca-reference-guide.html&quot;&gt;Java Cryptography Architecture (JCA) Reference Guide&lt;/a&gt;.&lt;/p&gt;
14 </documentation>
15 </annotation>
16
17 <element name="extension">
18 <annotation>
19 <appInfo>
20 <meta.element />
21 </appInfo>
22 </annotation>
23 <complexType>
24 <sequence>
25 <element ref="artifactChecksum" minOccurs="1" maxOccurs="unbounded"/>
26 </sequence>
27 <attribute name="point" type="string" use="required">
28 <annotation>
29 <documentation>
30
31 </documentation>
32 </annotation>
33 </attribute>
34 <attribute name="id" type="string">
35 <annotation>
36 <documentation>
37
38 </documentation>
39 </annotation>
40 </attribute>
41 <attribute name="name" type="string">
42 <annotation>
43 <documentation>
44
45 </documentation>
46 <appInfo>
47 <meta.attribute translatable="true"/>
48 </appInfo>
49 </annotation>
50 </attribute>
51 </complexType>
52 </element>
53
54 <element name="artifactChecksum">
55 <complexType>
56 <attribute name="id" type="string" use="required">
57 <annotation>
58 <documentation>
59 id of the checksum algorithm, i.e. &lt;code&gt;sha-512&lt;/code&gt;.
60
61 As other tools will rely on this id, consider using some well-defined value (i.e. &lt;a href=&quot;https://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xhtml&quot;&gt;Hash Function Textual Names&lt;/a&gt; ).
62 </documentation>
63 </annotation>
64 </attribute>
65 <attribute name="algorithm" type="string" use="required">
66 <annotation>
67 <documentation>
68 Name of the message digest algorithm as expected by &lt;code&gt;java.security.MessageDigest&lt;/code&gt;&apos;s method &lt;code&gt;getInstance(String)&lt;/code&gt;. Also check the MessageDigest section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard algorithm names.
69 </documentation>
70 </annotation>
71 </attribute>
72 <attribute name="providerName" type="string">
73 <annotation>
74 <documentation>
75 For custom security provider, name of the security provider that provides this message digest implementation, the value returned by &lt;code&gt;java.security.Provider.getName()&lt;/code&gt;.
76 </documentation>
77 </annotation>
78 </attribute>
79 <attribute name="warnInsecure" type="boolean">
80 <annotation>
81 <documentation>
82 Since 1.4.300
83 Set to true if this algorithm is now considered as insecure. A warning will be logged when this algorithm is used. An artifact that has no checksums or checksums only for insecure algorithms will emit a warning to user.
84 </documentation>
85 </annotation>
86 </attribute>
87 <attribute name="priority" type="string" use="default" value="0">
88 <annotation>
89 <documentation>
90 Gives a priority of this algorithm, algorithms with higher priority are preffered if multiple ones are applicable.
91 </documentation>
92 </annotation>
93 </attribute>
94 <attribute name="publish" type="boolean" use="default" value="true">
95 <annotation>
96 <documentation>
97 Controls if this checksum should be published when assembling a repository.
98 </documentation>
99 </annotation>
100 </attribute>
101 </complexType>
102 </element>
103
104 <annotation>
105 <appInfo>
106 <meta.section type="since"/>
107 </appInfo>
108 <documentation>
109 2.4.0
110 </documentation>
111 </annotation>
112
113 <annotation>
114 <appInfo>
115 <meta.section type="examples"/>
116 </appInfo>
117 <documentation>
118 To enable support for MessageDigest implementation which is provided by a statically registered Provider, contributing bundle should only register an extension:
119
120 &lt;pre&gt;
121 &lt;extension point=&quot;org.eclipse.equinox.p2.artifact.repository.artifactChecksums&quot;&gt;
122 &lt;artifactChecksum
123 algorithm=&quot;SHA3-512&quot;
124 id=&quot;sha3-512&quot;&gt;
125 &lt;/artifactChecksum&gt;
126 &lt;/extension&gt;
127 &lt;/pre&gt;
128
129 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 &lt;code&gt;java.security.Provider&lt;/code&gt;:
130
131 &lt;pre&gt;
132 import java.security.Provider;
133 import java.util.Dictionary;
134 import java.util.Hashtable;
135
136 import org.bouncycastle.jce.provider.BouncyCastleProvider;
137 import org.osgi.framework.BundleActivator;
138 import org.osgi.framework.BundleContext;
139 import org.osgi.framework.ServiceRegistration;
140
141 ...
142
143 Dictionary&lt;String, Object&gt; props = new Hashtable&lt;&gt;();
144 props.put(&quot;providerName&quot;, &quot;BC&quot;);
145 ServiceRegistration&lt;Provider&gt; registration = context.registerService(Provider.class, new BouncyCastleProvider(), props);
146 &lt;/pre&gt;
147
148 and then register an extension using &lt;code&gt;providerName&lt;/code&gt; attribute:
149
150 &lt;pre&gt;
151 &lt;extension point=&quot;org.eclipse.equinox.p2.artifact.repository.artifactChecksums&quot;&gt;
152 &lt;artifactChecksum
153 algorithm=&quot;Whirlpool&quot;
154 id=&quot;whirlpool&quot;
155 providerName=&quot;BC&quot;&gt;
156 &lt;/artifactChecksum&gt;
157 &lt;/extension&gt;
158 &lt;/pre&gt;
159 </documentation>
160 </annotation>
161
162
163 <annotation>
164 <appInfo>
165 <meta.section type="implementation"/>
166 </appInfo>
167 <documentation>
168 Contributes a checksum algorithm with id &lt;code&gt;sha-256&lt;/code&gt; and maps it to &lt;code&gt;SHA-256&lt;/code&gt; MessageDigest implementation.
169 </documentation>
170 </annotation>
171
172 <annotation>
173 <appInfo>
174 <meta.section type="copyright"/>
175 </appInfo>
176 <documentation>
177 Copyright (c) 2015, 2018 Mykola Nikishov.
178
179 This program and the accompanying materials are made
180 available under the terms of the Eclipse Public License 2.0 which
181 accompanies this distribution, and is available at
182 &lt;a href=&quot;https://www.eclipse.org/legal/epl-2.0&quot;&gt;https://www.eclipse.org/legal/epl-v20.html&lt;/a&gt;/
183
184 SPDX-License-Identifier: EPL-2.0
185 </documentation>
186 </annotation>
187
188 </schema>