Index: chrome/common/extensions/api/certificate_provider.idl |
diff --git a/chrome/common/extensions/api/certificate_provider.idl b/chrome/common/extensions/api/certificate_provider.idl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9b202754eb30f77b92b30c6c031b7124d60b7492 |
--- /dev/null |
+++ b/chrome/common/extensions/api/certificate_provider.idl |
@@ -0,0 +1,72 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Use this API to make certificates, for example from a Smart Card, available |
+// to the platform which can then use these certificates for TLS client |
+// authentication. |
+namespace certificateProvider { |
+ enum Hash { |
+ MD5_SHA1, |
+ SHA1, |
+ SHA256, |
+ SHA384, |
+ SHA512 |
+ }; |
+ |
+ dictionary CertificateInfo { |
+ // Must be the DER encoding of a X.509 client certificate. |
+ 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
|
+ |
+ // Must be set to all hashes supported for this certificate. This extension |
+ // will only be asked for signatures of digests calculated with one of these |
+ // hash algorithms. |
+ Hash[] supportedHashes; |
+ }; |
+ |
+ 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
|
+ // The digest that must be signed. |
+ ArrayBuffer digest; |
+ |
+ // Refers to the hash algorithm that was used to create |digest|. |
+ Hash hash; |
+ }; |
+ |
+ // Either |error| or |signature| and not both must be set. |
+ dictionary SignatureDetails { |
+ // If the signature of the digest could not be calculated, this field must |
+ // be set. |
+ DOMString? error; |
+ |
+ // If no error occurred, this field must be set to the signature of the |
+ // digest using the private the of the requested client certificate. |
+ // For an RSA key, the signature must be a PKCS#1 signature. The extension |
+ // is responsible for prepending the DigestInfo prefix and adding PKCS#1 |
+ // 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
|
+ ArrayBuffer? signature; |
+ }; |
+ |
+ callback DoneCallback = void (); |
+ |
+ interface Functions { |
+ // Notifies Chrome that this extension is capable of responding to signing |
+ // requests for the certificates listed in |certificates|. The list must |
+ // only contain certificates for which the extension can sign data |
+ // using the associated private key. |
+ static void publishClientCertificates(CertificateInfo[] certificates, |
+ 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,
|
+ |
+ // Responses to a previous |onSignDigestRequested| event. |requestId| must |
+ // match the id of such an event. For each id, this function must be called |
+ // exactly once. |
+ static void replyToSignRequest(long requestId, SignatureDetails reply); |
+ }; |
+ |
+ interface Events { |
+ // This event fires every time the browser needs to sign a message using a |
+ // certificate provided by this extension using |publishClientCertificates|. |
+ // The extension must sign the data in |request| using the appropriate |
+ // algorithm and private key and return it using |replyToSignRequest|. |
+ static void onSignDigestRequested(long requestId, SignRequest request); |
+ }; |
+}; |