(key)
| 19 | } = require('worker_threads'); |
| 20 | |
| 21 | function keyToString(key) { |
| 22 | let ret; |
| 23 | if (key instanceof CryptoKey) { |
| 24 | key = KeyObject.from(key); |
| 25 | } |
| 26 | if (key.type === 'secret') { |
| 27 | ret = key.export().toString('hex'); |
| 28 | } else { |
| 29 | ret = key.export({ type: 'pkcs1', format: 'pem' }); |
| 30 | } |
| 31 | return ret; |
| 32 | } |
| 33 | |
| 34 | // Worker threads simply reply with their representation of the received key. |
| 35 | if (process.env.HAS_STARTED_WORKER) { |
no test coverage detected
searching dependent graphs…