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 // Internal API for platform keys and certificate management. | |
6 [ nodoc = true, | |
not at google - send to devlin
2014/05/07 15:42:25
you don't need nodoc=true if you don't add documen
pneubeck (no reviews)
2014/05/08 15:04:17
Done.
| |
7 platforms = ("chromeos"), | |
8 implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enter prise_platform_keys_api.h" ] | |
9 namespace enterprise.platformKeysInternal { | |
10 // Invoked by <code>getTokens</code>. | |
11 // |tokenIds| The list of IDs of the avialable Tokens. | |
12 callback GetTokensCallback = void(DOMString[] tokenIds); | |
13 | |
14 // Invoked by <code>generateKey</code>. | |
15 // |publicKey| The Subject Public Key Info (see X.509) of the generated key | |
16 // in DER encoding. | |
17 callback GenerateKeyCallback = void(ArrayBuffer publicKey); | |
18 | |
19 // Invoked by <code>sign</code>. | |
20 // |signature| The signature, a octet string. | |
21 callback SignCallback = void(ArrayBuffer signature); | |
22 | |
23 interface Functions { | |
24 // Internal version of entrprise.platformKeys.getTokens. Returns a list of | |
25 // token IDs instead of token objects. | |
26 static void getTokens(GetTokensCallback callback); | |
27 | |
28 // Internal version of Token.generateKey, currently supporting only | |
29 // RSASSA-PKCS1-v1_5. | |
30 // |tokenId| The id of a Token returned by |getTokens|. | |
31 // |modulusLength| The length, in bits, of the RSA modulus. | |
32 // |callback| Called back with the Subject Public Key Info of the generated | |
33 // key. | |
34 static void generateKey(DOMString tokenId, | |
35 long modulusLength, | |
36 GenerateKeyCallback callback); | |
37 | |
38 // Internal version of Token.sign. | |
39 // |tokenId| The id of a Token returned by |getTokens|. | |
40 // |publicKey| The Subject Public Key Info of a key previously generated by | |
41 // |generateKey| in DER encoding. | |
42 // |data| The data to sign. | |
43 // |callback| Called back with the signature of |data|. | |
44 // TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView), | |
45 // or at least (ArrayBuffer or Uint8Array). | |
46 static void sign(DOMString tokenId, | |
47 ArrayBuffer publicKey, | |
48 ArrayBuffer data, | |
49 SignCallback callback); | |
50 }; | |
51 }; | |
OLD | NEW |