aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/crypto')
-rw-r--r--files/zh-cn/web/api/crypto/index.html61
-rw-r--r--files/zh-cn/web/api/crypto/subtle/index.html88
2 files changed, 149 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/crypto/index.html b/files/zh-cn/web/api/crypto/index.html
new file mode 100644
index 0000000000..25056293b3
--- /dev/null
+++ b/files/zh-cn/web/api/crypto/index.html
@@ -0,0 +1,61 @@
+---
+title: Crypto
+slug: Web/API/Crypto
+tags:
+ - 加密
+translation_of: Web/API/Crypto
+---
+<p>{{APIRef("Web Crypto API")}}</p>
+
+<p><code><strong>Crypto</strong></code> 接口提供了基本的加密功能,可用于当前的上下文中。它允许访问一个密码强度的随机数生成器和 cryptographic primitives。</p>
+
+<p>该接口在 Web 中可以通过 {{domxref("Window.crypto")}} 属性来访问。</p>
+
+<h2 id="属性">属性</h2>
+
+<p><em>该接口实现的属性定义在 {{domxref("RandomSource")}} 中。</em></p>
+
+<dl>
+ <dt>{{domxref("Crypto.subtle")}} {{experimental_inline}}{{readOnlyInline}}</dt>
+ <dd>返回一个 {{domxref("SubtleCrypto")}} 对象, 用来访问公共的 cryptographic primitives,例如哈希、签名、加密以及解密。</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<p><em>该接口实现的方法定义在 {{domxref("RandomSource")}} 中。</em></p>
+
+<dl>
+ <dt>{{ domxref("RandomSource.getRandomValues()") }}</dt>
+ <dd>使用 cryptographically sound 随机数填充 {{ jsxref("TypedArray") }}。</dd>
+</dl>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("Web Crypto API", "#crypto-interface", "Crypto")}}</td>
+ <td>{{Spec2("Web Crypto API")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+
+
+<p>{{Compat("api.Crypto")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Components.utils.importGlobalProperties">Components.utils.importGlobalProperties</a></li>
+</ul>
diff --git a/files/zh-cn/web/api/crypto/subtle/index.html b/files/zh-cn/web/api/crypto/subtle/index.html
new file mode 100644
index 0000000000..750c1dd189
--- /dev/null
+++ b/files/zh-cn/web/api/crypto/subtle/index.html
@@ -0,0 +1,88 @@
+---
+title: Crypto.subtle
+slug: Web/API/Crypto/subtle
+translation_of: Web/API/Crypto/subtle
+---
+<p>{{APIRef("Web Crypto API")}}</p>
+
+<p><strong><code>Crypto.subtle</code></strong> 是一个只读属性,返回一个 {{domxref("SubtleCrypto")}} 对象允许做一个些加密操作。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre>var <em>crypto</em> = crypto.subtle;</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{ SpecName('Web Crypto API', '#dfn-Crypto', 'Crypto.subtle') }}</td>
+ <td>{{ Spec2('Web Crypto API') }}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器支持">浏览器支持</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatChrome(37) }}</td>
+ <td>{{ CompatGeckoDesktop(34) }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatNo }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>37</td>
+ <td>{{ CompatGeckoMobile(34) }}</td>
+ <td>{{ CompatNo }}</td>
+ <td>{{ CompatUnknown() }}</td>
+ <td>{{ CompatNo }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="另见">另见</h2>
+
+<ul>
+ <li>{{domxref("Crypto")}}.</li>
+ <li>{{domxref("SubtleCrypto")}}.</li>
+</ul>