blob: 0add9721d217a18cd83f2a75315bbb63c0545b9d (
plain)
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
|
---
title: Crypto
slug: Web/API/Crypto
tags:
- API
- Interface
- NeedsTranslation
- Reference
- TopicStub
- Web Crypto API
translation_of: Web/API/Crypto
---
<p>{{APIRef("Web Crypto API")}}</p>
<p>The <code><strong>Crypto</strong></code> interface represents basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.</p>
<p>An object with this interface is available on Web context via the {{domxref("Window.crypto")}} property.</p>
<h2 id="Properties">Properties</h2>
<p><em>This interface implements properties defined on {{domxref("RandomSource")}}.</em></p>
<dl>
<dt>{{domxref("Crypto.subtle")}} {{experimental_inline}}{{readOnlyInline}}</dt>
<dd>Returns a {{domxref("SubtleCrypto")}} object providing access to common cryptographic primitives, like hashing, signing, encryption or decryption.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>This interface implements methods defined on {{domxref("RandomSource")}}.</em></p>
<dl>
<dt>{{domxref("Crypto.getRandomValues()")}}</dt>
<dd>Fills the passed {{ jsxref("TypedArray") }} with cryptographically sound random values.</dd>
</dl>
<h2 id="Specifications">Specifications</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="Browser_Compatibility">Browser Compatibility</h2>
<div>
<p>{{Compat("api.Crypto")}}</p>
</div>
<h2 id="See_Also">See Also</h2>
<ul>
<li><a href="/en-US/docs/Components.utils.importGlobalProperties">Components.utils.importGlobalProperties</a></li>
</ul>
|