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 // Custom binding for the platformKeys API. |
| 6 |
| 7 var binding = require('binding').Binding.create('platformKeys'); |
| 8 var SubtleCrypto = require('platformKeys.SubtleCrypto').SubtleCrypto; |
| 9 var internalAPI = require('platformKeys.internalAPI'); |
| 10 |
| 11 binding.registerCustomHook(function(api) { |
| 12 var apiFunctions = api.apiFunctions; |
| 13 var subtleCrypto = new SubtleCrypto('' /* tokenId */); |
| 14 |
| 15 apiFunctions.setHandleRequest( |
| 16 'selectClientCertificates', function(details, callback) { |
| 17 internalAPI.selectClientCertificates(details, callback); |
| 18 }); |
| 19 |
| 20 apiFunctions.setHandleRequest( |
| 21 'subtleCrypto', function() { return subtleCrypto }); |
| 22 }); |
| 23 |
| 24 exports.binding = binding.generate(); |
OLD | NEW |