From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/crypto/index.html | 61 +++++++++++++++++++ files/zh-cn/web/api/crypto/subtle/index.html | 88 ++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 files/zh-cn/web/api/crypto/index.html create mode 100644 files/zh-cn/web/api/crypto/subtle/index.html (limited to 'files/zh-cn/web/api/crypto') 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 +--- +

{{APIRef("Web Crypto API")}}

+ +

Crypto 接口提供了基本的加密功能,可用于当前的上下文中。它允许访问一个密码强度的随机数生成器和 cryptographic primitives。

+ +

该接口在 Web 中可以通过 {{domxref("Window.crypto")}} 属性来访问。

+ +

属性

+ +

该接口实现的属性定义在 {{domxref("RandomSource")}} 中。

+ +
+
{{domxref("Crypto.subtle")}} {{experimental_inline}}{{readOnlyInline}}
+
返回一个 {{domxref("SubtleCrypto")}} 对象, 用来访问公共的 cryptographic primitives,例如哈希、签名、加密以及解密。
+
+ +

方法

+ +

该接口实现的方法定义在 {{domxref("RandomSource")}} 中。

+ +
+
{{ domxref("RandomSource.getRandomValues()") }}
+
使用 cryptographically sound 随机数填充 {{ jsxref("TypedArray") }}。
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Web Crypto API", "#crypto-interface", "Crypto")}}{{Spec2("Web Crypto API")}}Initial definition
+ +

浏览器兼容

+ + + +

{{Compat("api.Crypto")}}

+ +

参见

+ + 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 +--- +

{{APIRef("Web Crypto API")}}

+ +

Crypto.subtle 是一个只读属性,返回一个 {{domxref("SubtleCrypto")}} 对象允许做一个些加密操作。

+ +

语法

+ +
var crypto = crypto.subtle;
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('Web Crypto API', '#dfn-Crypto', 'Crypto.subtle') }}{{ Spec2('Web Crypto API') }}Initial definition.
+ +

浏览器支持

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatChrome(37) }}{{ CompatGeckoDesktop(34) }}{{ CompatNo() }}{{ CompatUnknown() }}{{ CompatNo }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}37{{ CompatGeckoMobile(34) }}{{ CompatNo }}{{ CompatUnknown() }}{{ CompatNo }}
+
+ +

另见

+ + -- cgit v1.2.3-54-g00ecf