Chromium Code Reviews| Index: extensions/common/api/networking_cast.idl |
| diff --git a/extensions/common/api/networking_cast.idl b/extensions/common/api/networking_cast.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..781014bd01b9c6ac6beaf44ffe12846d16892497 |
| --- /dev/null |
| +++ b/extensions/common/api/networking_cast.idl |
| @@ -0,0 +1,109 @@ |
| +// Copyright 2017 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. |
| + |
| +// The networking.cast API is a private API that exposes networking utilities |
| +// needed by cast extension and setup app. |
| +[nodoc] namespace networking.cast { |
|
Devlin
2017/03/13 05:21:49
Does this belong at the //extensions level instead
tbarzic
2017/03/13 22:35:01
Hm, yeah, I guess we could move it to //chrome ins
|
| + enum TDLSStatus { |
| + // TDLS is connected. |
| + Connected, |
|
Devlin
2017/03/13 05:21:49
If items have to migrate over anyway, make these S
tbarzic
2017/03/13 22:35:01
Done.
|
| + // TDLS is not supported. |
| + Nonexistent, |
| + // TDLS is supported, but disabled. |
| + Disabled, |
| + // TDLS is enabled, but not connected |
| + Disconnected, |
| + // TDLS status is not yet determined. |
| + Unknown |
| + }; |
| + |
| + dictionary VerificationProperties { |
| + // A string containing a PEM-encoded (including the 'BEGIN CERTIFICATE' |
| + // header and 'END CERTIFICATE' footer) X.509 certificate for use in |
| + // verifying the signed data. |
| + DOMString certificate; |
| + |
| + // An array of PEM-encoded X.509 intermediate certificate authority |
| + // certificates. Each PEM-encoded certificate is expected to have the |
| + // 'BEGIN CERTIFICATE' header and 'END CERTIFICATE' footer. |
| + DOMString[]? intermediateCertificates; |
| + |
| + // A string containing a base64-encoded RSAPublicKey ASN.1 structure, |
| + // representing the public key to be used by |
| + // $(ref:verifyAndEncryptCredentials) and $(ref:verifyAndEncryptData) |
| + // methods. |
| + DOMString publicKey; |
| + |
| + // A string containing a base64-encoded random binary data for use in |
| + // verifying the signed data. |
| + DOMString nonce; |
| + |
| + // A string containing the identifying data string signed by the device. |
| + DOMString signedData; |
| + |
| + // A string containing the serial number of the device. |
| + DOMString deviceSerial; |
| + |
| + // A string containing the SSID of the device. Should be empty for new |
| + // configurations. |
| + DOMString deviceSsid; |
| + |
| + // A string containing the BSSID of the device. Should be empty for new |
| + // configurations. |
| + DOMString deviceBssid; |
| + }; |
| + |
| + callback BooleanCallback = void(boolean result); |
| + callback StringCallback = void(DOMString result); |
| + callback TDLSStatusCallback = void(TDLSStatus status); |
| + |
| + interface Functions { |
| + // Verifies that the device is a trusted device. |
| + // |properties|: Properties of the destination to use in verifying that it |
| + // is a trusted device. |
| + // |callback|: A callback function that indicates whether or not the device |
| + // is a trusted device. |
| + static void verifyDestination(VerificationProperties properties, |
| + BooleanCallback callback); |
| + |
| + // Verifies that the device is a trusted device and retrieves encrypted |
| + // network credentials. |
| + // |properties|: Properties of the destination to use in verifying that it |
| + // is a trusted device. |
| + // |networkGuid|: The GUID of the Cellular network to activate. |
| + // |callback|: A callback function that receives base64-encoded encrypted |
| + // credential data to send to a trusted device. |
| + static void verifyAndEncryptCredentials(VerificationProperties properties, |
| + DOMString networkGuid, |
| + StringCallback callback); |
| + |
| + // Verifies that the device is a trusted device and encrypts supplied |
| + // data with device public key. |
| + // |properties|: Properties of the destination to use in verifying that it |
| + // is a trusted device. |
| + // |data|: A string containing the base64-encoded data to encrypt. |
| + // |callback|: A callback function that receives base64-encoded encrypted |
| + // data to send to a trusted device. |
| + static void verifyAndEncryptData(VerificationProperties properties, |
| + DOMString data, |
| + StringCallback callback); |
| + |
| + // Enables TDLS for WiFi traffic with a specified peer if available. |
| + // |ip_or_mac_address|: The IP or MAC address of the peer with which to |
| + // enable a TDLS connection. |
| + // |enabled| If true, enable TDLS, otherwise disable TDLS. |
|
Devlin
2017/03/13 05:21:49
nit: |enabled|: - missing ':'
tbarzic
2017/03/13 22:35:01
Done.
|
| + // |callback|: A callback function that receives a string with an error or |
| + // the current TDLS status. |
| + static void setWifiTDLSEnabledState(DOMString ip_or_mac_address, |
| + boolean enabled, |
| + optional TDLSStatusCallback callback); |
| + |
| + // Returns the current TDLS status for the specified peer. |
| + // |ip_or_mac_address|: The IP or MAC address of the peer. |
| + // |callback|: A callback function that receives a string with the current |
| + // TDLS status. |
| + static void getWifiTDLSStatus(DOMString ip_or_mac_address, |
| + TDLSStatusCallback callback); |
| + }; |
| +}; |