Add test for #setPrivateKey