SSH Certificate based authentication does not work

It's the standard private key; that's not changed 'cos it key material is still the same; it's just the public key has a CA-signed certificate added to it.

In a general scenario you end up with files like id_rsa, id_rsa.pub and id_rsa-cert.pub. There's no id_rsa-cert, although OpenSSH will look for one as a belts-and-suspenders.

That's why my example code uses id_rsa and id_rsa-cert.pub as the two files needed.

I think the OpenSSH Agent code was modified to handle certs by adding the cert public key as well as the private key

$ ssh-add -l  
The agent has no identities.
$ ssh-add
Identity added: /home/sweh/.ssh/id_rsa (/home/sweh/.ssh/id_rsa)
Certificate added: /home/sweh/.ssh/id_rsa-cert.pub (user_sweh)