Closed OronDF343 closed 2 months ago
Hi @OronDF343,
Thanks for looking into this :clap: The problem didn't occur for a year so, as you said, it's probably related to older keys.
PemParse.cs
is a tricky one as it was blatantly copied from an obscur source, without any sense of ownership or testing - which is why I tried to stay away from it.
Description
Fixes edge case Exception importing private key when
D
is shorter in length thanMODULUS
by 8 bits or more.If
D
is shorter, it is copied to the end of a new array with the same length asMODULUS
. Naive, but this is a rare edge case.Motivation and Context
This fixes issue #357 that I just ran into using an older Vonage application private key.
How Has This Been Tested?
Ran unit tests with old and new keys and published to our production server (which uses multiple private keys).