File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " node-rsa" ,
3
- "version" : " 0.1.40 " ,
3
+ "version" : " 0.1.41 " ,
4
4
"description" : " Node.js RSA library" ,
5
5
"main" : " src/NodeRSA.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ module.exports = (function() {
72
72
* @param publicPEM {string}
73
73
*/
74
74
NodeRSA . prototype . loadFromPrivatePEM = function ( privatePEM , encoding ) {
75
- var pem = privatePEM . replace ( '-----BEGIN RSA PRIVATE KEY-----' , '' ) . replace ( '-----END RSA PRIVATE KEY-----' , '' ) ;
75
+ var pem = privatePEM
76
+ . replace ( '-----BEGIN RSA PRIVATE KEY-----' , '' )
77
+ . replace ( '-----END RSA PRIVATE KEY-----' , '' )
78
+ . replace ( / \s + | \n | \r $ / gm, '' ) ;
76
79
var reader = new ber . Reader ( new Buffer ( pem , 'base64' ) ) ;
77
80
78
81
reader . readSequence ( ) ;
@@ -96,7 +99,10 @@ module.exports = (function() {
96
99
* @param privatePEM {string}
97
100
*/
98
101
NodeRSA . prototype . loadFromPublicPEM = function ( publicPEM , encoding ) {
99
- var pem = publicPEM . replace ( '-----BEGIN PUBLIC KEY-----' , '' ) . replace ( '-----END PUBLIC KEY-----' , '' ) ;
102
+ var pem = publicPEM
103
+ . replace ( '-----BEGIN PUBLIC KEY-----' , '' )
104
+ . replace ( '-----END PUBLIC KEY-----' , '' )
105
+ . replace ( / \s + | \n | \r $ / gm, '' ) ;
100
106
var reader = new ber . Reader ( new Buffer ( pem , 'base64' ) ) ;
101
107
102
108
reader . readSequence ( ) ;
You can’t perform that action at this time.
0 commit comments