diff --git a/.travis.yml b/.travis.yml index 27819f5242..6a9b087a76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,15 @@ script: npm run coverage after_script: npx codecov jobs: include: + - stage: macOS + os: osx + script: npm run coverage + node_js: stable + - stage: windows + os: windows + script: npm run coverage + node_js: node - stage: Lint script: npm run lint - node_js: stable + node_js: node after_script: skip diff --git a/lib/help/key_utils.js b/lib/help/key_utils.js index 1878b64e98..c2462b4210 100644 --- a/lib/help/key_utils.js +++ b/lib/help/key_utils.js @@ -1,3 +1,4 @@ +const { EOL } = require('os') const keyto = require('@trust/keyto') const errors = require('../errors') @@ -8,7 +9,12 @@ module.exports.keyObjectToJWK = (keyObject) => { const type = keyObject.type === 'private' ? 'pkcs8' : 'spki' const format = 'pem' - const pem = keyObject.export({ type, format }) + let pem = keyObject.export({ type, format }) + + // keyObject export always uses \n but @trust/keyto splits based on the os.EOL + if (EOL !== '\n') { + pem = pem.replace(/\n/g, EOL) + } return keyto.from(pem, 'pem').toJwk(keyObject.type) }