Fixed padding management when reading certificate

I broke the padding management when hardening certificate.c. Please apply.