(expected, got)
| 365 | // matching values for each property that was expected? It's okay if the |
| 366 | // returned object has extra methods; they aren't checked. |
| 367 | function equalJwk(expected, got) { |
| 368 | var fields = Object.keys(expected); |
| 369 | var fieldName; |
| 370 | |
| 371 | for(var i=0; i<fields.length; i++) { |
| 372 | fieldName = fields[i]; |
| 373 | if (!(fieldName in got)) { |
| 374 | return false; |
| 375 | } |
| 376 | if (objectToString(expected[fieldName]) !== objectToString(got[fieldName])) { |
| 377 | return false; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | return true; |
| 382 | } |
| 383 | |
| 384 | // Jwk format wants Base 64 without the typical padding at the end. |
| 385 | function byteArrayToUnpaddedBase64(byteArray){ |
no test coverage detected