Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3016)

Unified Diff: chrome/common/extensions/api/certificate_provider.idl

Issue 1232553003: Add new certificateProvider extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ };
+};
« no previous file with comments | « chrome/common/extensions/api/_permission_features.json ('k') | chrome/common/extensions/api/platform_keys.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698