samlify
samlify copied to clipboard
Private keys must of PKCS#1-formatted
When specifying private keys for signing, the key format must be PKCS#1. If PKCS#8 format is used, it results in the (not so useful) error message Key format must be specified
. The easy fix would be to describe this requirement in the documentation and/or to provide a better error message.
The reason is that the node-rsa
library attempts to infer the format of the key (unless an optional format
parameter is specified). Samlify does not specify this parameter, and the PKCS#8 format does not include the key format: https://github.com/tngan/samlify/blob/16ded23ac2c0a487cc6bbb8518e0f42e37a35779/src/libsaml.ts#L477