OLD | NEW |
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 Loading... |
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']}); | |
OLD | NEW |