OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 this API to make certificates, for example from a Smart Card, available | |
6 // to the platform which can then use these certificates for TLS client | |
7 // authentication. | |
8 namespace certificateProvider { | |
9 enum Hash { | |
10 MD5_SHA1, | |
11 SHA1, | |
12 SHA256, | |
13 SHA384, | |
14 SHA512 | |
15 }; | |
16 | |
17 dictionary CertificateInfo { | |
18 // Must be the DER encoding of a X.509 client certificate. | |
19 ArrayBuffer certificate; | |
davidben
2015/07/10 14:03:32
Is there a story for the smartcard sending a certi
pneubeck (no reviews)
2015/08/17 12:13:03
We can add this if it ever becomes an important re
| |
20 | |
21 // Must be set to all hashes supported for this certificate. This extension | |
22 // will only be asked for signatures of digests calculated with one of these | |
23 // hash algorithms. | |
24 Hash[] supportedHashes; | |
25 }; | |
26 | |
27 dictionary SignRequest { | |
davidben
2015/07/10 14:03:32
Shouldn't this include the certificate we're tryin
pneubeck (no reviews)
2015/07/10 15:17:25
ops. of course. I'll probably add
// The certific
| |
28 // The digest that must be signed. | |
29 ArrayBuffer digest; | |
30 | |
31 // Refers to the hash algorithm that was used to create |digest|. | |
32 Hash hash; | |
33 }; | |
34 | |
35 // Either |error| or |signature| and not both must be set. | |
36 dictionary SignatureDetails { | |
37 // If the signature of the digest could not be calculated, this field must | |
38 // be set. | |
39 DOMString? error; | |
40 | |
41 // If no error occurred, this field must be set to the signature of the | |
42 // digest using the private the of the requested client certificate. | |
43 // For an RSA key, the signature must be a PKCS#1 signature. The extension | |
44 // is responsible for prepending the DigestInfo prefix and adding PKCS#1 | |
45 // padding. | |
davidben
2015/07/10 14:03:32
Nit: Dunno if it's worth explicitly mentioning her
pneubeck (no reviews)
2015/07/10 15:17:25
Yes, we should probably explain such in more detai
pneubeck (no reviews)
2015/08/17 12:13:02
I'll remove MD5_SHA1 for now. Doesn't seem to be r
davidben
2015/08/18 21:17:52
[Commented in other CL, but MD5_SHA1 is the only h
| |
46 ArrayBuffer? signature; | |
47 }; | |
48 | |
49 callback DoneCallback = void (); | |
50 | |
51 interface Functions { | |
52 // Notifies Chrome that this extension is capable of responding to signing | |
53 // requests for the certificates listed in |certificates|. The list must | |
54 // only contain certificates for which the extension can sign data | |
55 // using the associated private key. | |
56 static void publishClientCertificates(CertificateInfo[] certificates, | |
57 DoneCallback callback); | |
davidben
2015/07/10 14:03:32
Any reason why it's publicClientCertificates and n
pneubeck (no reviews)
2015/08/17 12:13:02
(thoroughly discussed in the implementation in ano
davidben
2015/08/18 21:17:52
It seems it's a getClientCertificates API now but,
| |
58 | |
59 // Responses to a previous |onSignDigestRequested| event. |requestId| must | |
60 // match the id of such an event. For each id, this function must be called | |
61 // exactly once. | |
62 static void replyToSignRequest(long requestId, SignatureDetails reply); | |
63 }; | |
64 | |
65 interface Events { | |
66 // This event fires every time the browser needs to sign a message using a | |
67 // certificate provided by this extension using |publishClientCertificates|. | |
68 // The extension must sign the data in |request| using the appropriate | |
69 // algorithm and private key and return it using |replyToSignRequest|. | |
70 static void onSignDigestRequested(long requestId, SignRequest request); | |
71 }; | |
72 }; | |
OLD | NEW |