[chrome] Add chrome.enterprise.networkingAttributes and update chrome.platformKeys (#45683)

* Update chrome.enterprise.networkingAttributes and chrome.platformKeys

* Add since Chrome 85 comment

Co-authored-by: pokutuna <popopopopokutuna@gmail.com>

* Add API works only on Chrome OS comment

Co-authored-by: pokutuna <popopopopokutuna@gmail.com>

Co-authored-by: pokutuna <popopopopokutuna@gmail.com>
This commit is contained in:
Maria Petrișor 2020-07-07 19:52:14 +02:00 committed by GitHub
parent d676227b87
commit 2485c414a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2588,6 +2588,33 @@ declare namespace chrome.enterprise.deviceAttributes {
export function getDeviceAnnotatedLocation(callback: (annotatedLocation: string) => void): void;
}
////////////////////
// Enterprise Networking Attributes
////////////////////
/**
* Use the <code>chrome.enterprise.networkingAttributes</code> API to read information about your current network. Note: This API is only available to extensions force-installed by enterprise policy.
* Important: This API works only on Chrome OS.
* @since Chrome 85.
*/
declare namespace chrome.enterprise.networkingAttributes {
export interface NetworkDetails {
/** The device's MAC address. */
macAddress: string;
/** Optional. The device's local IPv4 address (undefined if not configured). */
ipv4?: string;
/** Optional. The device's local IPv6 address (undefined if not configured). */
ipv6?: string;
}
/**
* Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, runtime.lastError will be set with a failure reason.
* @param callback Called with the device's default network's NetworkDetails.
* The callback parameter should be a function that looks like this:
* function(NetworkDetails networkAddresses) {...};
*/
export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
}
////////////////////
// Events
////////////////////
@ -5080,6 +5107,18 @@ declare namespace chrome.platformKeys {
* Optional parameter privateKey: Might be null if this extension does not have access to it.
*/
export function getKeyPair(certificate: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void): void;
/**
* Passes the key pair of publicKeySpkiDer for usage with platformKeys.subtleCrypto to callback.
* @param publicKeySpkiDer A DER-encoded X.509 SubjectPublicKeyInfo, obtained e.g. by calling WebCrypto's exportKey function with format="spki".
* @param parameters Provides signature and hash algorithm parameters, in addition to those fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, we need to also pass a "hash" parameter { "hash": { "name": string } }. The "hash" parameter represents the name of the hashing algorithm to be used in the digest operation before a sign. It is possible to pass "none" as the hash name, in which case the sign function will apply PKCS#1 v1.5 padding and but not hash the given data.
* Currently, this function only supports the "RSASSA-PKCS1-v1_5" algorithm with one of the hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and "SHA-512".
* @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
* The callback parameter should be a function that looks like this:
* function(object publicKey, object privateKey) {...};
* Optional parameter privateKey: Might be null if this extension does not have access to it.
* @since Chrome 85.
*/
export function getKeyPairBySpki(publicKeySpkiDer: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey: CryptoKey | null) => void): void;
/** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */
export function subtleCrypto(): SubtleCrypto;
/**