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

Side by Side Diff: chrome/renderer/resources/extensions/platform_keys/subtle_crypto.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 2015 The Chromium Authors. All rights reserved. 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 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 internalAPI = require('platformKeys.internalAPI'); 6 var internalAPI = require('platformKeys.internalAPI');
7 var keyModule = require('platformKeys.Key'); 7 var keyModule = require('platformKeys.Key');
8 var getSpki = keyModule.getSpki; 8 var getSpki = keyModule.getSpki;
9 var KeyUsage = keyModule.KeyUsage; 9 var KeyUsage = keyModule.KeyUsage;
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (key.type != 'public') 103 if (key.type != 'public')
104 throw CreateInvalidAccessError(); 104 throw CreateInvalidAccessError();
105 resolve(getSpki(key)); 105 resolve(getSpki(key));
106 } else { 106 } else {
107 // TODO(pneubeck): It should be possible to export to format 'jwk'. 107 // TODO(pneubeck): It should be possible to export to format 'jwk'.
108 throw CreateNotSupportedError(); 108 throw CreateNotSupportedError();
109 } 109 }
110 }); 110 });
111 }; 111 };
112 112
113 function SubtleCrypto() {
114 privates(SubtleCrypto).constructPrivate(this, arguments);
115 }
116 utils.expose(SubtleCrypto, SubtleCryptoImpl, {
117 functions: [
118 'sign',
119 'exportKey',
120 ],
121 });
122
113 // Required for subclassing. 123 // Required for subclassing.
114 exports.SubtleCryptoImpl = SubtleCryptoImpl 124 exports.$set('SubtleCryptoImpl', SubtleCryptoImpl);
115 125 exports.$set('SubtleCrypto', SubtleCrypto);
116 exports.SubtleCrypto =
117 utils.expose('SubtleCrypto',
118 SubtleCryptoImpl,
119 {functions:['sign', 'exportKey']});
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698