Open nlfiedler opened 1 year ago
I'm not sure it makes sense. It's added to DecodingKey because you commonly get them as components (eg JWKs). It's much rarer for the encoding part.
This is actually something that I would love to have, I'm aware that it's a rare use case but we do use the JWK format to represent our private keys. A from_rsa_components()
or even from_jwk()
would be greatly appreciated.
I'm presently using the rsa crate and creating a private/public key pair, then creating an
EncodingKey
from that. For now, it seems that I must convert the private key to a PEM encoded string and then createEncodingKey
from that. I would like to skip that step if I may. I took a brief look at the code and it seems thatDecodingKey
andEncodingKey
are built up differently, so it's not obvious to me if adding anfrom_rsa_components()
toEncodingKey
is a good idea or not. But it sure would be convenient. If you have any suggestions, I can give it a try myself and submit a PR.