Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseCert failing with x509.js but working with x509 #3

Open
biswasaveek opened this issue Mar 5, 2018 · 5 comments
Open

parseCert failing with x509.js but working with x509 #3

biswasaveek opened this issue Mar 5, 2018 · 5 comments

Comments

@biswasaveek
Copy link

biswasaveek commented Mar 5, 2018

var x509 = require('x509.js'); // FAILS
//var x509 = require('x509'); // PASSES

var certStr = '-----BEGIN CERTIFICATE-----' + '\n' +
'MIIDyzCCArOgAwIBAgIIOWfJGl2YroswDQYJKoZIhvcNAQELBQAwMTEOMAwGA1UEAwwFVkRQQ0ExEjAQBgNVBAoMCVZEUFZJU0FDQTELMAkGA1UEBhMCVVMwHhcNMTgwMzA1MDk0MzI2WhcNMjAwMzA0MDk0MzI2WjCBmDEbMBkGCSqGSIb3DQEJARYMdmRwQHZpc2EuY29tMS0wKwYDVQQDDCRmZjg3YzRmOS0xNzFjLTRkNzQtOTU3Yi1lNTEyNWYxNzNiNmMxDDAKBgNVBAsMA1ZEUDENMAsGA1UECgwEVklTQTETMBEGA1UEBwwKRm9zdGVyQ2l0eTELMAkGA1UECAwCQ0ExCzAJBgNVBAYTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApemzO1BkYXK497KgvH5Ow02wYHHu3vKfbzxL1UO935iFl8epKVZXeHWaXdbPNii39WtobTfavvJJ9gqQDD+pXLCBs2GIYnwZAr23xrP5+9Y+l3ZSUh4EyMglQICeYSYZ9H23Q04X0wi+vuT2BrKd3mKVt6XYlXhkOHzrUzZTlAu17t2anAbheC118uUgsEh9RjmZX6zunmZWVCqFl8rvrivSLgDwCpM6M94xtKOzg7rbAFyfPvubqiDHY8Rz9ijr6gahSKsDY2yZ/T0lhvLUpbEeVOJ8neGoKerhzzt7mbBDT8bhXyBncXWsR5sL7aeNvibui4Ak20IOMs0G76jUNQIDAQABo38wfTAdBgNVHQ4EFgQU7l/rxHvAxweW3ZR/fkB5QW0JNccwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBTfwbxRkW00Q9iJYMH8/JlIc9IHLTAOBgNVHQ8BAf8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMA0GCSqGSIb3DQEBCwUAA4IBAQCE7PEtMBNYFb+HLCQ430FaU54c1PGms/3kxKd25UIvR7Zsix1EN6TfbXxBbpp/6E55shWkEC+ii5bIE6Yw6nat3280uWRs/W0qZxj4Hn7biIuBBEX/B3uEAW/rUNADzh1+FBBqrtbOrIV/fg7yM8tSx5aamZfKimO6bpqLvKnPsZgNIlKJ8p1WS2P98P+jrXq9UZBnrphEryZ21Vv4XINQO+oMFS74Llw5dUDdq2hC+xid0Fge87DdbLBE5cAnUypGq+oFiaMltsuYaKhiByJUeZXRIf2u6HWwDXIDgheyK/lUArEWDhBjsVTxDCVsLDhuBH5d7cgCrZVfjc2mkneI' +
'\n' + '-----END CERTIFICATE-----';

var parsedStr = x509.parseCert(certStr);

@Rush
Copy link
Member

Rush commented Mar 5, 2018

Thank you for the report.

@mikesmullin
Copy link

same here. i tried it with and without the BEGIN and END certificate strings. i also tried sending in a Buffer

@davidkhala
Copy link

Has this project been deprecated? Or is author still here?

@Rush
Copy link
Member

Rush commented Nov 23, 2018 via email

@Budgiebrain994
Copy link

Good evening @biswasaveek
We have solved this issue by adding a newline in at exactly each 64 characters. The RFC standard mandates this (https://tools.ietf.org/html/rfc7468).
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants