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 | 6 |
7 /** | 7 /** |
8 * Enum of possible key types (subset of WebCrypto.KeyType). | 8 * Enum of possible key types (subset of WebCrypto.KeyType). |
9 * @enum {string} | 9 * @enum {string} |
10 */ | 10 */ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 */ | 62 */ |
63 function getSpki(key) { | 63 function getSpki(key) { |
64 if (!privates(key)) | 64 if (!privates(key)) |
65 throw new Error('Invalid key object.'); | 65 throw new Error('Invalid key object.'); |
66 var keyImpl = privates(key).impl; | 66 var keyImpl = privates(key).impl; |
67 if (!keyImpl || !keyImpl.spki) | 67 if (!keyImpl || !keyImpl.spki) |
68 throw new Error('Invalid key object.'); | 68 throw new Error('Invalid key object.'); |
69 return keyImpl.spki; | 69 return keyImpl.spki; |
70 } | 70 } |
71 | 71 |
72 exports.Key = Key; | 72 exports.$set('Key', Key); |
73 exports.KeyType = KeyType; | 73 exports.$set('KeyType', KeyType); |
74 exports.KeyUsage = KeyUsage; | 74 exports.$set('KeyUsage', KeyUsage); |
75 exports.getSpki = getSpki; | 75 exports.$set('getSpki', getSpki); |
OLD | NEW |