func TestKeyEqual(t *testing.T) {
key, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
t.Fatal("failed generating private key: ", err)
}
if !key.PublicKey.Equal(key.PublicKey) {
t.Fatal("key mismatch")
}
}
Why is that ? Shouldn’t it return true ?
Initially I compared key after save and reload read, and since it failed, I just tested the same key for equality to verify that Equal was working as expected. Apparently it does not or I’m doing something wrong.