@@ -117,17 +117,20 @@ describe("NodeRSA", function(){
117
117
"KY4kQIIx8JEBsAYzgyP2iy0CAwEAAQ==\n" +
118
118
"-----END PUBLIC KEY-----" ;
119
119
120
+ var privateKeyPEMNotTrimmed = ' \n\n \n\n ' + privateKeyPEM + '\n \n \n\n ' ;
121
+ var publicKeyPEMNotTrimmed = '\n\n\n\n ' + publicKeyPEM + '\n \n\n\n ' ;
122
+
120
123
describe ( "Good cases" , function ( ) {
121
- it ( ".loadFromPrivatePEM() should load private key from PEM string" , function ( ) {
122
- privateNodeRSA = new NodeRSA ( privateKeyPEM ) ;
124
+ it ( ".loadFromPrivatePEM() should load private key from (not trimmed) PEM string" , function ( ) {
125
+ privateNodeRSA = new NodeRSA ( privateKeyPEMNotTrimmed ) ;
123
126
assert . instanceOf ( privateNodeRSA . keyPair , Object ) ;
124
127
assert ( privateNodeRSA . isPrivate ( ) ) ;
125
128
assert ( privateNodeRSA . isPublic ( ) ) ;
126
129
assert ( ! privateNodeRSA . isPublic ( true ) ) ;
127
130
} ) ;
128
131
129
- it ( ".loadFromPublicPEM() should load public key from PEM string" , function ( ) {
130
- publicNodeRSA = new NodeRSA ( publicKeyPEM ) ;
132
+ it ( ".loadFromPublicPEM() should load public key from (not trimmed) PEM string" , function ( ) {
133
+ publicNodeRSA = new NodeRSA ( publicKeyPEMNotTrimmed ) ;
131
134
assert . instanceOf ( privateNodeRSA . keyPair , Object ) ;
132
135
assert ( publicNodeRSA . isPublic ( ) ) ;
133
136
assert ( publicNodeRSA . isPublic ( true ) ) ;
0 commit comments