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

Side by Side Diff: chrome/renderer/resources/extensions/enterprise_platform_keys/key_pair.js

Issue 1938123002: Ensure that privates are private. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698