forge
                                
                                 forge copied to clipboard
                                
                                    forge copied to clipboard
                            
                            
                            
                        The `pki.decryptRsaPrivateKey` function can return null if the password is wrong
The types for pki.decryptRsaPrivateKey indicates that it will always return a rsa.PrivateKey. However if the password is wrong, it will sometimes throw an error, and sometimes return a null.
The null is not indicated by the type signature at all. This threw off me quite a bit, because this is random behaviour as it depends on the generated key as well. The exact exception being thrown is also random.
This tripped me up, too
I agree, has the same problem. My password contains "$" sign... and result is null. This problem need to be fixed.