Skip to content

Commit

Permalink
fix: importing x5c in electron requires the input split
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 27, 2019
1 parent 60efc06 commit 181fd09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jwk/key/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Key {
let publicKey
try {
publicKey = createPublicKey({
key: `-----BEGIN CERTIFICATE-----\n${cert}\n-----END CERTIFICATE-----`, format: 'pem'
key: `-----BEGIN CERTIFICATE-----\n${cert.match(/.{1,64}/g).join('\n')}\n-----END CERTIFICATE-----`, format: 'pem'
})
} catch (err) {
throw new errors.JWKInvalid(`\`x5c\` member at index ${i} is not a valid base64-encoded DER PKIX certificate`)
Expand Down

0 comments on commit 181fd09

Please sign in to comment.