-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathfaq-java.html
More file actions
322 lines (208 loc) · 12.5 KB
/
Copy pathfaq-java.html
File metadata and controls
322 lines (208 loc) · 12.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="zh-CN" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="zh-CN" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Java SDK FAQ — WeIdentity 文档</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/theme_overrides.css" type="text/css" />
<link rel="stylesheet" href="../_static/index.css" type="text/css" />
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
<script src="../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../index.html" class="icon icon-home"> WeIdentity
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../README.html">什么是 WeIdentity?</a></li>
<li class="toctree-l1"><a class="reference internal" href="one-stop-experience.html">WeIdentity 一站式体验</a></li>
<li class="toctree-l1"><a class="reference internal" href="terminologies.html">术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="use-cases.html">使用场景</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-spec.html">WeIdentity 规范</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-installation.html">WeIdentity Java SDK 安装部署</a></li>
<li class="toctree-l1"><a class="reference external" href="https://weidentity.readthedocs.io/projects/javasdk/zh_CN/latest/">WeIdentity Java SDK 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-sample.html">WeIdentity Sample 开发样例</a></li>
<li class="toctree-l1"><a class="reference internal" href="miscellaneous.html">杂项</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-rest.html">WeIdentity RestService</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-endpoint.html">WeIdentity Endpoint Service</a></li>
<li class="toctree-l1"><a class="reference internal" href="weidentity-contract-design.html">WeIdentity 智能合约设计与实现</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">WeIdentity</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> »</li>
<li>Java SDK FAQ</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/docs/faq-java.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="java-sdk-faq">
<h1>Java SDK FAQ<a class="headerlink" href="#java-sdk-faq" title="永久链接至标题">¶</a></h1>
<p>即Maven上下载的weidentity-java-sdk</p>
<hr class="docutils" />
<ul class="simple">
<li><p>weidentity-java-sdk 跟能在哪些版本的 JDK 下运行?</p></li>
</ul>
<p>详见<a class="reference external" href="./weid-compatibility-test.html">WeIdentity Java SDK 与各版本JDK的兼容性</a>。</p>
<p>JAVA 8 <a class="reference external" href="https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html">https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html</a></p>
<ul class="simple">
<li><p>如何配置可信时间戳服务?</p></li>
</ul>
<p>当前,我们支持使用WeSign(<a class="reference external" href="https://fintech.webank.com/wesign/">https://fintech.webank.com/wesign/</a>)作为时间戳的签发者服务方。未来,我们会进一步支持各种境内外的可信时间戳服务商。</p>
<p>您首先需要联系WeSign团队,获取可用的测试或生产环境的URL及账号。接下来,访问您的weidentity.properties,将以下内容配置项填入:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>wesign.accessTokenUrl<span class="o">=</span><access token的地址>
wesign.signTicketUrl<span class="o">=</span><sign ticket的地址>
wesign.timestampUrl<span class="o">=</span><timestamp服务的地址>
wesign.appId<span class="o">=</span><服务商为您分配的appId>
wesign.secret<span class="o">=</span><服务商为您分配的secret>
</pre></div>
</div>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>智能合约和 SDK 版本号相关问题</strong></p></li>
</ul>
<p>详见<a class="reference external" href="./styleguides/versioning-management.html">版本号管理</a>。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>Smart Contract(智能合约)的如何升级?</strong></p></li>
</ul>
<p>WeIdentity 智能合约是按分层设计的,分为:<em>数据层,逻辑层,权限层</em>。
数据层合约被当做类似数据库的表来使用,充分预留的字段,所以数据层合约基本稳定。
在大多数情况下,WeIdentity 智能合约的升级的时候只会升级逻辑层和权限层,
所以升级的时候之前的数据完全保留,部署新的合约(需要传入升级前数据合约的合约地址)后,直接使用新的合约即可。
如果需要升级数据层合约,则需要做数据迁移或者在逻辑层做特殊逻辑。更多信息请看 <a class="reference external" href="./weidentity-contract-design.html">WeIdentity智能合约设计</a>。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>如何查看当前 WeIdentity JAVA SDK(weid-java-sdk)的版本号?</strong></p></li>
</ul>
<p>三种方式可以查看 SDK 的版本号:</p>
<ol class="arabic">
<li><p>下载的jar包会带有版本号,例如:<code class="docutils literal notranslate"><span class="pre">weidentity-java-sdk-1.0.1.jar</span></code>,版本号是v1.0.1。</p></li>
<li><p>通过 <code class="docutils literal notranslate"><span class="pre">MANIFEST.MF</span></code> 查看,可以运行下面的命令,查看输出项
<code class="docutils literal notranslate"><span class="pre">Manifest-Version</span></code> 显示的版本号:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>unzip -p weid-java-sdk-1.0.1.jar META-INF/MANIFEST.MF
</pre></div>
</div>
</li>
<li><p>如果是下载的源代码,则项目的 <code class="docutils literal notranslate"><span class="pre">build.gradle</span></code> 文件里面的变量
<code class="docutils literal notranslate"><span class="pre">version</span></code> 定义了 SDK 的版本号。</p></li>
</ol>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>Authoritzation是什么?</strong></p></li>
</ul>
<p>这里要区分两种授权类型:</p>
<ol class="arabic simple">
<li><p>一是 WeIdentity DID
层面的授权,即实体可以(暂时地)将自己的身份的部分或者全部控制权授权给另一个实体,另一个实体可以代替原实体进行相关的操作的过程。</p></li>
<li><p>用户在A机构的数据需要流转到B机构,需要得到用户的授权,这是不同于1的机制。例如用户的处方信息存储在机构A,需要流转到机构B,这个时候用户可以授权这个数据流转,并叫授权操作上链。</p></li>
</ol>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>执行某些接口的时候为什么要传入私钥?</strong></p></li>
</ul>
<p>调用合约的时候需要调用方(WeIdentity DID持有者)的私钥,用来签名交易。签发Credential的时候亦然。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>目前支持哪些密钥管理套件?</strong></p></li>
</ul>
<p>目前,我们使用ECDSA
SECP256套件进行密钥生成、签名验证操作。未来会加入国密版本套件。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>为什么要使用 tx.origin?我听说它有很多问题!</strong></p></li>
</ul>
<p>使用tx.origin是因为比起传统的RBAC/ABAC(Role/ABAC Based Access
Control),WeIdentity的权限控制合约需要支持更大的可扩展性,以支持更多公众联盟链的参与成员实现不同的控制合约。在这种情况下,只有tx.origin才能稳定地追踪到调用者的WeIdentity
DID,也即“WeIdBAC”(WeIdentity Based Access
Control)。此外,在一个不需要token的区块链世界里,tx.origin有着比msg.sender更广泛的适用性。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>如何运行JAVA SDK单元测试?</strong></p></li>
</ul>
<p>详见<a class="reference external" href="./how-to-run-unit-test.html">如何运行单元测试</a>。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>如何在无Internet外网连接状态下部署WeIdentity?</strong></p></li>
</ul>
<p>详见<a class="reference external" href="./how-to-run-without-internet.html">网络访问受限时的部署方法</a>。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>我原来的配置文件是applicationContext.xml,现在怎么兼容properties?</strong></p></li>
</ul>
<p>详见<a class="reference external" href="./from-application-context-to-properties.html">从ApplicationContext.xml兼容properties的配置方式</a>。</p>
<hr class="docutils" />
<ul class="simple">
<li><p><strong>我使用的是maven方式集成,怎么集成WeID SDK相关依赖?</strong></p></li>
</ul>
<p>请您参考源代码根目录下build.gradle的依赖,按照以下格式添加到您的pom.xml里。添加之前请先确定要使用的SDK版本。</p>
<blockquote>
<div><div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><dependency>
<groupId>com.webank</groupId>
<artifactId>weid-java-sdk</artifactId>
<version>1.4.0</version>
</dependency>
</pre></div>
</div>
</div></blockquote>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright (2018) WeBank Co., Ltd.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/translations.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>