OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Use the <code>chrome.enterprise.platformKeys</code> API to generate |
| 6 // hardware-backed keys and to install certificates for these keys. The |
| 7 // certificates will be available to the platform and can, for example, be used |
| 8 // for TLS authentication and network access. |
| 9 [ platforms = ("chromeos") ] |
| 10 namespace enterprise.platformKeys { |
| 11 [nocompile] dictionary Token { |
| 12 // The unique identifier of this Token. |
| 13 DOMString id; |
| 14 |
| 15 // Implements the WebCrypto.SubtleCrypto interface. The crypto operations |
| 16 // are hardware-backed. |
| 17 [instanceOf = SubtleCrypto] object subtleCrypto; |
| 18 }; |
| 19 // Invoked by <code>getTokens</code> with the list of available Tokens. |
| 20 callback GetTokensCallback = void(Token[] tokens); |
| 21 |
| 22 // Callback to which the certificates are passed. |
| 23 callback GetCertificatesCallback = void(ArrayBuffer[] certificates); |
| 24 |
| 25 // Invoked by importCertificate or removeCertificate when the respective |
| 26 // operation is finished. |
| 27 callback DoneCallback = void(); |
| 28 |
| 29 interface Functions { |
| 30 // Gets all available Tokens. |
| 31 [nocompile] static void getTokens(GetTokensCallback callback); |
| 32 |
| 33 // Gets all certificates of the token with |tokenId|. |
| 34 static void getCertificates(DOMString tokenId, |
| 35 GetCertificatesCallback callback); |
| 36 |
| 37 // Imports |certificate| to the token with |tokenId|. |
| 38 // TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView), |
| 39 // or at least (ArrayBuffer or Uint8Array). |
| 40 static void importCertificate(DOMString tokenId, |
| 41 ArrayBuffer certificate, |
| 42 optional DoneCallback callback); |
| 43 |
| 44 // Removes |certificate| from the token with |tokenId|. |
| 45 // TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView), |
| 46 // or at least (ArrayBuffer or Uint8Array). |
| 47 static void removeCertificate(DOMString tokenId, |
| 48 ArrayBuffer certificate, |
| 49 optional DoneCallback callback); |
| 50 }; |
| 51 }; |
OLD | NEW |