| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var utils = require('utils'); | 5 var utils = require('utils'); |
| 6 var intersect = require('platformKeys.utils').intersect; | 6 var intersect = require('platformKeys.utils').intersect; |
| 7 var keyModule = require('platformKeys.Key'); | 7 var keyModule = require('platformKeys.Key'); |
| 8 var Key = keyModule.Key; | 8 var Key = keyModule.Key; |
| 9 var KeyType = keyModule.KeyType; | 9 var KeyType = keyModule.KeyType; |
| 10 var KeyUsage = keyModule.KeyUsage; | 10 var KeyUsage = keyModule.KeyUsage; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 algorithm, | 23 algorithm, |
| 24 intersect([KeyUsage.verify], usages), | 24 intersect([KeyUsage.verify], usages), |
| 25 true /* extractable */); | 25 true /* extractable */); |
| 26 this.privateKey = new Key(KeyType.private, | 26 this.privateKey = new Key(KeyType.private, |
| 27 publicKeySpki, | 27 publicKeySpki, |
| 28 algorithm, | 28 algorithm, |
| 29 intersect([KeyUsage.sign], usages), | 29 intersect([KeyUsage.sign], usages), |
| 30 false /* not extractable */); | 30 false /* not extractable */); |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 exports.KeyPair = utils.expose('KeyPair', | 33 function KeyPair() { |
| 34 KeyPairImpl, | 34 privates(KeyPair).constructPrivate(this, arguments); |
| 35 {readonly:['publicKey', 'privateKey']}); | 35 } |
| 36 utils.expose(KeyPair, KeyPairImpl, { |
| 37 readonly: [ |
| 38 'publicKey', |
| 39 'privateKey', |
| 40 ], |
| 41 }); |
| 42 |
| 43 exports.$set('KeyPair', KeyPair); |
| OLD | NEW |