OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Internal API for platform keys and certificate management. | 5 // Internal API for platform keys and certificate management. |
6 [ platforms = ("chromeos"), | 6 [ platforms = ("chromeos"), |
7 implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enter prise_platform_keys_api.h" ] | 7 implemented_in = "chrome/browser/extensions/api/enterprise_platform_keys/enter prise_platform_keys_api.h" ] |
8 namespace enterprise.platformKeysInternal { | 8 namespace enterprise.platformKeysInternal { |
9 // Invoked by <code>getTokens</code>. | 9 // Invoked by <code>getTokens</code>. |
10 // |tokenIds| The list of IDs of the avialable Tokens. | 10 // |tokenIds| The list of IDs of the avialable Tokens. |
11 callback GetTokensCallback = void(DOMString[] tokenIds); | 11 callback GetTokensCallback = void(DOMString[] tokenIds); |
12 | 12 |
13 // Invoked by <code>generateKey</code>. | 13 // Invoked by <code>generateKey</code>. |
14 // |publicKey| The Subject Public Key Info (see X.509) of the generated key | 14 // |publicKey| The Subject Public Key Info (see X.509) of the generated key |
15 // in DER encoding. | 15 // in DER encoding. |
16 callback GenerateKeyCallback = void(ArrayBuffer publicKey); | 16 callback GenerateKeyCallback = void(ArrayBuffer publicKey); |
17 | 17 |
18 // Invoked by <code>sign</code>. | 18 // Invoked by <code>sign</code>. |
19 // |signature| The signature, a octet string. | 19 // |signature| The signature, a octet string. |
20 callback SignCallback = void(ArrayBuffer signature); | 20 callback SignCallback = void(ArrayBuffer signature); |
21 | 21 |
22 interface Functions { | 22 interface Functions { |
23 // Internal version of entrprise.platformKeys.getTokens. Returns a list of | 23 // Internal version of entrprise.platformKeys.getTokens. Returns a list of |
24 // token IDs instead of token objects. | 24 // token IDs instead of token objects. |
25 static void getTokens(GetTokensCallback callback); | 25 static void getTokens(GetTokensCallback callback); |
26 | 26 |
27 // Internal version of Token.generateKey, currently supporting only | 27 // Internal version of Token.generateKey, currently supporting only |
28 // RSASSA-PKCS1-v1_5. | 28 // RSASSA-PKCS1-v1_5. |
29 // |tokenId| The id of a Token returned by |getTokens|. | 29 // |tokenId| The id of a Token returned by |getTokens|. |
30 // |modulusLength| The length, in bits, of the RSA modulus. | 30 // |modulusLength| The length, in bits, of the RSA modulus. |
not at google - send to devlin
2014/06/03 17:53:33
|publicExponent| ...
| |
31 // |callback| Called back with the Subject Public Key Info of the generated | 31 // |callback| Called back with the Subject Public Key Info of the generated |
32 // key. | 32 // key. |
33 static void generateKey(DOMString tokenId, | 33 static void generateKey(DOMString tokenId, |
34 long modulusLength, | 34 long modulusLength, |
35 Uint8Array publicExponent, | |
35 GenerateKeyCallback callback); | 36 GenerateKeyCallback callback); |
36 | 37 |
37 // Internal version of Token.sign. | 38 // Internal version of Token.sign. |
38 // |tokenId| The id of a Token returned by |getTokens|. | 39 // |tokenId| The id of a Token returned by |getTokens|. |
39 // |publicKey| The Subject Public Key Info of a key previously generated by | 40 // |publicKey| The Subject Public Key Info of a key previously generated by |
40 // |generateKey| in DER encoding. | 41 // |generateKey| in DER encoding. |
41 // |data| The data to sign. | 42 // |data| The data to sign. |
42 // |callback| Called back with the signature of |data|. | 43 // |callback| Called back with the signature of |data|. |
43 // TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView), | 44 // TODO: Instead of ArrayBuffer should be (ArrayBuffer or ArrayBufferView), |
44 // or at least (ArrayBuffer or Uint8Array). | 45 // or at least (ArrayBuffer or Uint8Array). |
45 static void sign(DOMString tokenId, | 46 static void sign(DOMString tokenId, |
46 ArrayBuffer publicKey, | 47 ArrayBuffer publicKey, |
47 ArrayBuffer data, | 48 ArrayBuffer data, |
48 SignCallback callback); | 49 SignCallback callback); |
49 }; | 50 }; |
50 }; | 51 }; |
OLD | NEW |