Open nigredo-tori opened 4 years ago
It's true that ECGOST keys or GOST* signature algorithms are not supported in KSE right now. Mostly because I know nothing about them at all, I don't use them and nobody else has requested support for them so far.
The reason why KSE restricts imports to certain algorithms is that an unknown key type will most probably cause problems later after the import when you try to do something with it in KSE (like signing something or saving it in another format).
I am open for PRs to support GOST algorithms, but only when they do not generate a wave of new bug tickets.
I get the following exception when trying to import the attached PKCS8 key pair (password
1234
):Error
AFAICT, this is caused by the hardcoded signature algorithm choice here. To check a
ECGOST3410-2012
key pair, we should use eitherGOST3411-2012-256WITHECGOST3410-2012-256
orGOST3411-2012-512WITHECGOST3410-2012-512
signature algorithm. Choosing the right one seems to be difficult with justPrivateKey
, though. We might want to get the actualPrivateKeyInfo
structure here somehow, and get the algorithm OID from it. I have the following mapping right now:, but there are probably more corner cases.
More generally, we might want to allow importing key pairs without checking them, since this check algorithm doesn't cover all known key algorithms.