(formatStr, defaultFormat, optionName)
| 348 | }); |
| 349 | |
| 350 | function parseKeyFormat(formatStr, defaultFormat, optionName) { |
| 351 | if (formatStr === undefined && defaultFormat !== undefined) |
| 352 | return defaultFormat; |
| 353 | else if (formatStr === 'pem') |
| 354 | return kKeyFormatPEM; |
| 355 | else if (formatStr === 'der') |
| 356 | return kKeyFormatDER; |
| 357 | else if (formatStr === 'jwk') |
| 358 | return kKeyFormatJWK; |
| 359 | else if (formatStr === 'raw-public') |
| 360 | return kKeyFormatRawPublic; |
| 361 | else if (formatStr === 'raw-private') |
| 362 | return kKeyFormatRawPrivate; |
| 363 | else if (formatStr === 'raw-seed') |
| 364 | return kKeyFormatRawSeed; |
| 365 | throw new ERR_INVALID_ARG_VALUE(optionName, formatStr); |
| 366 | } |
| 367 | |
| 368 | function parseKeyType(typeStr, required, keyType, isPublic, optionName) { |
| 369 | if (typeStr === undefined && !required) { |
no outgoing calls
no test coverage detected
searching dependent graphs…